I want to use an array for my fieldnames (field[1], field[2], etc.) instead of names like "first_name ", "last_name" , etc.
It works from an HTML standpoint, but I can't seem to access the contents of those text input fields from Javascript. The code below works 100% if I change "field[3]" to any normal variable name like "last_name" .
[CODE=javascript] if (cust_last_name .length < 1) {
eval('document. forms.info.fiel d[3].style.backgrou ndColor = "#FFCCCC";' );
eval('document. forms.info.fiel d[3].focus();');
alert("Please fill in the Last Name field.");
return false;
}
[/CODE]
How can I do what I'm trying to do?
Thanks,
Matthew
It works from an HTML standpoint, but I can't seem to access the contents of those text input fields from Javascript. The code below works 100% if I change "field[3]" to any normal variable name like "last_name" .
[CODE=javascript] if (cust_last_name .length < 1) {
eval('document. forms.info.fiel d[3].style.backgrou ndColor = "#FFCCCC";' );
eval('document. forms.info.fiel d[3].focus();');
alert("Please fill in the Last Name field.");
return false;
}
[/CODE]
How can I do what I'm trying to do?
Thanks,
Matthew
Comment