Question

I'm trying to validate my XHTML 1.0 but I've got 2 error's which I can't seem to fix no matter what. Could someone just take a look at it and if so provide alternatives to it? When I change 'email' to text my JS stops working.

Line 49, Column 58: there is no attribute "required"

…id="first-name"  type="text" required="required" onkeypress="return onlyAlphab…


Error Line 63, Column 41: value of attribute "type" cannot be "email"; must be one of "text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button"
Was it helpful?

Solution

The "required" attribute and the "type=email" come with HTML5, your document use xhtml 1.0 strict.

You can :

  • change the doctype to HTML5 : <!DOCTYPE html>

or

  • remove those attribute / type :)

OTHER TIPS

XHTML has no input of type email and has no form validation so required does not exists. Those are elements are added in HTML5

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top