• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

checked="checked" Not Allowed

ibaker

Well-known member
#1
In the process of cleaning up some loose ends on my site and when I validated it I came up with an error for checked="checked"

I use it to have the remember me check box ticked for all users so in the login-bar-form template I have hidden the check box and made it default checked:
Code:
<input type="hidden" name="remember" value="1" id="ctrl_remember" tabindex="103" checked="checked" />
However when I validate the error says:
Attribute checked not allowed on element input at this point.

Can anyone advise how to fix?

As a side note I am finding a lot of small errors in the validation of the core templates:
 

Jake Bunce

XenForo moderator
Staff member
#6
Thanks, so how do I make it checked by default and hidden?
Hidden fields just have a value and that's it. Hidden fields are already hidden. And there is no such thing as a "checked" hidden field. It's effectively always checked. The value is always submitted with the form.
 

ibaker

Well-known member
#7
So I don't have to set it as "True" or anything, just have this:
Code:
<input type="hidden" name="remember" value="1" id="ctrl_remember" />
Thanks Guys!
 

Hoffi

Well-known member
#8
Yes. A checkbox return the value, if it's checked. So, this ist no checkbox, the given value will be transferred to the script.

Just as I said. remove tabindex and checked.