When will I update my semester that time by default a checkbox to be checked how it possible ?
<select name="semester">
<option value="">Select Semester</option>
<option value="1">Semester 1</option>
<option value="2">Semester 2</option>
<option value="3">Semester 3</option>
</select>
You can use the selected
attribute.
<select name="semester">
<option value="">Select Semester</option>
<option value="1" selected="selected">Semester 1</option>
<option value="2">Semester 2</option>
<option value="3">Semester 3</option>
</select>
Please try this
<select name="semester">
<option value="">Select Semester</option>
<option value="1" <?php if($data['semester']==1){echo 'selected';}?>>Semester 1</option>
<option value="2" <?php if($data['semester']==2){echo 'selected';}?>>Semester 2</option>
<option value="3" <?php if($data['semester']==3){echo 'selected';}?>>Semester 3</option>
</select>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With