开发者

Need help echoing the checked boxes selected by the user

开发者 https://www.devze.com 2023-02-13 10:31 出处:网络
How to display selected c开发者_运维问答heckbox? I tried but it didnt work <input type=checkboxvalue=\"Administrative\"<?php echo ($industry_sector1a == \'Administrative\' ? \'selected=\"select

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
0

精彩评论

暂无评论...
验证码 换一张
取 消