How to display selected c开发者_运维问答heckbox? I tried but it didnt work
<input type=checkbox value="Administrative"<?php echo ($industry_sector1a == 'Administrative' ? 'selected="selected"' : ''); ?>name="industry_sector1"> Administrative
I use the below for drop down boxes .
<option value="-1"<?php echo ($native_language == '-1' ? 'selected="selected"' : ''); ?>>----- Please Select -----</option>
<option value="1"<?php echo ($native_language == '1' ? 'selected="selected"' : ''); ?>>English - United States</option>
<input type="checkbox" checked="checked" name="foo" />bar
Yo need to use
<input type="checkbox" value="Administrative" <?php echo ($industry_sector1a == 'Administrative') ? 'checked="checked"' : ''; ?> name="industry_sector1"> Administrative
精彩评论