How to set value for select tag ,as when i tried for text field
<input type="input" name="name" value="<?php echo set_value('name') ?>"/>
its working but when i tried for select tag
<SELECT class="form-control" name="user" style="width:200px;">
<option value="">--Select--</option>
<?php
foreach ($result as $row):
echo "<option value='" . $row['id'] . "' >" . $row['employee_name'];
?>
<?php endforeach ?>
</SELECT>
its not working ,when validation run falls its again showing --Select-- option
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…