J
J. Hall
Hi guys,
Witten a function to check two input boxes, ensure that only one has a
numerical value in, but I'm gettng the javascript error 'Object expected'??
function
Ash_CheckCommission(TheFormToCheck,TheFieldToCheck,TheFieldToDisable) {
if (eval('document.'+TheFormToCheck+'.'+TheFieldToCheck+'.value > 0 &&
document.'+TheFormToCheck+'.'+TheFieldToDisable+'.value > 0')) {
alert('You may only enter a Commission Percentage OR Commission Fee, not
both.');
eval('document.'TheFormToCheck+'.'+TheFieldToDisable+'.value="0"');
}
}
I'm calling the function by putting it on the OnChange attribute of each
text box, it DID work UNTIL I put the +TheFormToCheck+ bits in there, prior
to this I had hardcoded the name of the form into the function.
Appreciate your help!
Cheers, Ash
Witten a function to check two input boxes, ensure that only one has a
numerical value in, but I'm gettng the javascript error 'Object expected'??
function
Ash_CheckCommission(TheFormToCheck,TheFieldToCheck,TheFieldToDisable) {
if (eval('document.'+TheFormToCheck+'.'+TheFieldToCheck+'.value > 0 &&
document.'+TheFormToCheck+'.'+TheFieldToDisable+'.value > 0')) {
alert('You may only enter a Commission Percentage OR Commission Fee, not
both.');
eval('document.'TheFormToCheck+'.'+TheFieldToDisable+'.value="0"');
}
}
I'm calling the function by putting it on the OnChange attribute of each
text box, it DID work UNTIL I put the +TheFormToCheck+ bits in there, prior
to this I had hardcoded the name of the form into the function.
Appreciate your help!
Cheers, Ash