2009/10/22

Validate forms XHTML 1.0 Strict

I ran into some trouble with the forms validation because I was using a javascript:document.formname.submit() which would require a name for the form. As it turns out, form name is deprecated in XHTML 1.0 Strict and XHTML 1.1.
In other words

is not valid in XHTML 1.0 Strict and XHTML 1.1.

To get around this issue, I used and in my link I used javascript:document.forms['blah'].submit(); which validates correctly.

Also, to get around the carriage return problem in input tags of forms (for input tags to validate correctly in XHTML 1.0 Strict and XHTML 1.1, they have to surrounded by

or h1 etc. ) I surrounded my inputs by (gasp) fieldsets and then hid it by styling the fieldset so I could get them all in one line. Im sure a lot of people know about these already, but this is for my future reference.



reference:http://weblogtoolscollection.com/archives/2004/08/16/validate-forms-xhtml-10-strict/

No comments:

Post a Comment