<form method="post">
<select name="select_employee" id="select_employee">
<?php $allemp=$this->AllEmployees; ?>
<option selected value="">Select an employee..</option>
<?php foreach($allemp as $row){ echo "<option value=".$row[ 'Id']. ">".$row[ 'Etunimi']. " - ". $row[ 'Sukunimi']. "</option>"; } ?>
</select>
<input type="hidden" name="send" value="namesent">
<input type="submit" value="submit" id="button">
</form>
<br/>
<br/>
選擇當我提交這種形式,我留在同一頁上,但我希望有一個相同的時間內保持選定的選項前面的選項可見。我怎麼能這樣做? 我想:保存選擇從下拉框中
document.getElementById('select_employee').value = "<?php echo $_GET['select_employee'];?>";
但它沒有工作..
像魅力一樣工作謝謝你! – 2013-03-05 13:14:11
@MNaibibaaziz:酷:D – 2013-03-05 13:14:53