Forum Moderators: open
if(krono_process.assocID.options[0].selected)
{
..
}
Warning: Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
And my form looks like this:
<form action="khours.asp" method="post" name="krono_process" onsubmit="return validateKronos(this);" autocomplete="off">
..
</form>
Oh, one more thing -- 'autocomplete="off"' isn't validated, what is the alternative for it? This web page will be used for data entry and I do not want autocomplete to interfer their operations.
Either of these 2 statements should make the warning go away:
a) Using older, "document collections", code:
You have sent a ref to the form to the function:
onsubmit="return validateKronos(this);" Let's assume that you have this:
function validateKronos(form) Then:
if( form.elements.assocID.options[0].selected ) b) A mixture of older and newer code
if( document.getElementsByName('assocID')[0].getElementsByTagName('option')[0].selected) ------------------
RE: autocomplete
Either
a) Write a new DTD for your document
b) Simply ignore validator warnings about this particular invalid attribute. Browsers don't validate documents anyway.
I already changed my document to conform your a. part suggestion, at least for now. I'm using Firefox, IE (all versions), Opera and lynx (paramount important) to test my application development. Warning went away except for document part.