php - How to hide, pre-set and disable a select tag -
how hidden select option tag . when try put hidden in select can still see in php page don't know why ? input tag easy hidden select option difficult hide
<select type="hidden" style="text-color:white;"name="syearid" class="select2_group form-control" style="text-align:center;" > <?php $yearnow=date('y'); include('../connection/connect.php'); $result = $db->prepare("select * school_year"); $result->bindparam(':syearid', $res); $result->execute(); ($i=0; $row = $result->fetch(); $i++) { $isselected = (($yearnow=date('y') == $row['from_year']) ? " selected" : ""); echo "<option style='text-color:white;' value='".$row['syearid']."'$isselected>".$row['from_year'].'-'.$row['to_year']."</option>"; } ?> </select>
<select name="syearid" class="select2_group form-control" style="text-align:center;text-color:white;display:none;" >
display:none;
hide select tag.
note can (better):
<style> #syearid{text-align:center;text-color:white;display:none;} </style> <select id="syearid" name="syearid" class="select2_group form-control" >
to pre-set value, , disable control, can this:
<select disabled> <option>car</option> <option selected>bus</option> <option>van</option> </select>
Comments
Post a Comment