Hi,
I've got a problem with the javascript below. I receive an error stating that there is an "Expected Identifier" on lin3 13 char 37 which is the line beginning var getWhichField.
variables are to be passed to the script via a form field
What am I doing wrong.
NB. Ideally I'd like to be able to pass any number of fields in the onChange event to disable multiple fields... is this possible?
Thanks,
Richard
I've got a problem with the javascript below. I receive an error stating that there is an "Expected Identifier" on lin3 13 char 37 which is the line beginning var getWhichField.
Code:
//Disable Fields
function disableField (thisField, whichField)
{
var getThisField = document.form1. + thisField;
var getWhichField = document.form1. + whichField;
if (getThisField.value == '') {
getWhichField.disabled = false;
} else {
if (getWhichField == '') {
getWhichField.disabled = true;
}else{
document.alert("You should not add a value as you already are using the " + whichField + " Field")
}
}
}
variables are to be passed to the script via a form field
Code:
onChange="disableField('redirect','webaddress')"
What am I doing wrong.
NB. Ideally I'd like to be able to pass any number of fields in the onChange event to disable multiple fields... is this possible?
Thanks,
Richard