Martin Honnen wrote:
Quote:
droesler@comcast.net wrote:
>
Quote:
I have a function that receives a form name and field name.
someFunc(formName, fieldName) {
var fieldVal = document.forms[formName].elements[fieldName].value;
[snip]
}
This triggers the 'has no properties error.
>
Quote:
The generated document passes the w3c validator test, although that
doesn't look at all of the sourced javascript files; and the Mozilla
JavaScript console shows no errors until the above function is called.
>
Show us the function call so that we know the actual parameter values,
then show us the corresponding HTML markup for the form and the element.
Or post a URL where the problem occurs. Does the problem only occur
with Mozilla or other browsers too?
>
The HTML markup with the function call:
<a href="javascript
:getEmail('officeInfo', 'officeEmail')"
title="Click here to select email addresses...">eMail</a>
<input type="text" name="officeEmail" value="$officeEmail"
tabindex="9">
The javascript function:
function getEmail(formName, fieldName) {
var email =
window.document.forms[formName].elements[fieldName].value;
if (email.length 0) {
email += ",";
}
var link = "/cgi-bin/ldapEmailPickList.pl?formName=" + formName +
"&fieldName=" + fieldName;
link += "&emailList=" + email;
window.open(link, "", "menubar, scrollbars, resizable, width=650,
height=600");
return;
}