PDA

View Full Version : make checkbox checked


Evil X
24 Nov 2005, 16:28
how do I make a checkbox checked by default



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Alan @ CIT
24 Nov 2005, 17:54
Add:

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

to the <input> tag.

Marco van Herwaarden
24 Nov 2005, 21:20
Isn't it just "checked"?

And you would be breaking the progam logic. The following is already setting checked if it is needed:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


If you want to change the behaviour, i suggest you look into the code.

merk
24 Nov 2005, 22:24
I think some people used checked="checked" because its believed to be necessary. Ive only ever used checked or selected, though.

Marco van Herwaarden
24 Nov 2005, 22:28
Lol not all browser like the checked=checked

Dontom
25 Nov 2005, 12:13
This is normal HTML syntax.
<input type="radio" name="Typ" value="bla" checked>

However, to be XHTML-compliant you should use it like this
<input type="radio" name="Typ" value="bla" checked="checked">

Thomas