<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'];?>";
但它没有工作..