chemo Posted November 21, 2006 Share Posted November 21, 2006 When trying to validate a form <form name="myMenu"> <select name="menu"> <option value="0”>xxxx</option> <option value="0">xxxx</option> <option value="0">xxxx</option> </select> <input type="button" onclick="location=document.mymenu.menu.options[document.myMenu.menu.selectedIndex].value;" value="GO!"> </form> W3C failed it for this reason, which I do not understand. Can anyone help.1. Error Line 173 column 14: there is no attribute "name". <form name="myMenu">You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash. ✉ 2. Error Line 173 column 22: required attribute "action" not specified. <form name="myMenu">The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element. Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>. Link to comment Share on other sites More sharing options...
aspnetguy Posted November 21, 2006 Share Posted November 21, 2006 you must be using a sctrict or XHTML doctype. name has been depreciated but sometimes is still need for somthings (JavaScript, PHP, etc) Link to comment Share on other sites More sharing options...
Err Posted November 21, 2006 Share Posted November 21, 2006 For your second error, add action="" to your form. That should be one less error. The first error like aspnetguy mentioned has to do with your DTD. You can try to change to a transitional DTD instead, like this one for example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Links:http://www.w3schools.com/tags/tag_form.asp (<form>)http://www.w3schools.com/tags/tag_doctype.asp (DTD) Link to comment Share on other sites More sharing options...
chemo Posted November 22, 2006 Author Share Posted November 22, 2006 Thanks Aspnetguy and RahXephon.Yes I was using using a strict doctype, which I changed to<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">along with action="" Problem solved. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now