0

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"

2 Answers 2

1

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 :)
Sign up to request clarification or add additional context in comments.

9 Comments

Is there any alternatives to it besides rewriting everything?
I just edited my answer : change your doctype or remove those part of code.
I'm trying to make it work with XHTML not with HTML5 :/ So there's no alternatives? Just have to re-write my JS?
I'm afraid there's no alternative : you wanna use HTML5 element in non-HTML5 document. The real question is : why you wanna make it work as XHTML 1 strict if you use HTML5 ? :)
Post your JS part if you want some help with that.
|
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.