开发者

PHP: how to mark a radio button as checked on pageload?

I'm looking for an at开发者_开发技巧tribute like checked="checked" for checkboxes which i can echo out in php..


That would be checked="checked"


<?php echo 'checked="checked"'; ?>


HTML solution:

<input type="radio" name="imgsel" value="" checked="checked" />

Please note, that the actual value of checked attribute does not actually matter; it's just a convention to assign "checked". Most importantly, strings like "true" or "false" don't have any special meaning.

If you don't aim for HTML conformance, you can simplify the code to:

<input type="radio" name="imgsel" value="" checked>

I hope its helpful for you

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜