Forum Moderators: phranque
It reads:
Line 45, column 59: there is no attribute "NAME"<form name="form" class="margin" action="">
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.
Now, i've narrowed this down to my "header" area of my website, which includes the following code:
<form name="form" class="margin" action="">
<select name="site" size=1 onChange="javascript:formHandler()">
<option value="">Browse Our Network
<option value="http://www.surplusnetworks.com">Surplus Networks</option>
<option value="http://www.surplusnetworks.com/bb">Surplus Community</option>
</select>
</FORM>
The actually entry on my webpage, with regards to the Javascript programming is:
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
Any advise regarding this is appreciated - when this is done, everything will validate correctly! yay!
Thanks,
Andrew.
Line 45, column 59: there is no attribute "NAME"<form [b]name="form"[/b] class="margin" action="">
It's as it says: there is no attribute "name" defined in the DTD you have selected. Which doctype are you using?
You can replace
name="form" with id="form", but you may need to adjust your Javascript in consequence.
I had this problem with a form on one of my pages a while back. I removed the "form name" section (wasn't at all necessary in my application), which made it happy.... I have other "name" selectors in the same form, but they aren't causing any problems.
If there's a reason for using "form name = form" that you can't go around, then you might try seeing if there's a newer version of the script you want to use, a different but similar script out there somewhere, or as encyclo says, use "id" instead of form and try to tweak the script so it works.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Ah-ha! HTML 4.0 messed up and left out the
name attribute for the form tag. This was fixed in HTML 4.01 - and as the latest corrected version with all the bug fixes, that is the version you should be using. You just need to switch your doctype to this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0[b]1[/b] Transitional//EN"> Then your page will validate with the
name attribute in place.