php - Set name to dropdownlist from database? -


i have problem dropdownlist. when press in dropdown fill table don't show here. want the dropdown has save thing pressed , give himself name. don't know how this.

look @ how hold selected list value after clicking go button?.

my code:

<form id="form" method="post" class="form-inline">                 <div class="form-group">                     <label for='select'>head:</label>                     <select  class="form-control" onchange="this.form.submit()">                     <?php                             //my $con else.                             $resultname = $con->query("select * ond");                                                          while ($row = $resultname->fetch_assoc()) {                                             echo '<option value="'.$row["ondid"].'">'.$row['name'].'</option>';                                      }                                                    ?>                     </select>                                                </div>               </div>           </form> 

from comment understood want selected dropdown option value onchange() event.

function check(val)  {  	alert(val);  }
<form id="form" method="post" class="form-inline">  	<div class="form-group">  		<label for='select'>head:</label>  		<select  class="form-control" onchange="check(this.value)">  			<option value="test">test</option>  			<option value="test1">test1</option>  		</select>                                 	</div>    </div>    </form>


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -