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_CheckCommis sion(TheFormToC heck,TheFieldTo Check,TheFieldT oDisable) {
if (eval('document .'+TheFormToChe ck+'.'+TheField ToCheck+'.value > 0 &&
document.'+TheF ormToCheck+'.'+ TheFieldToDisab le+'.value > 0')) {
alert('You may only enter a Commission Percentage OR Commission Fee, not
both.');
eval('document. 'TheFormToCheck +'.'+TheFieldTo Disable+'.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_CheckCommis sion(TheFormToC heck,TheFieldTo Check,TheFieldT oDisable) {
if (eval('document .'+TheFormToChe ck+'.'+TheField ToCheck+'.value > 0 &&
document.'+TheF ormToCheck+'.'+ TheFieldToDisab le+'.value > 0')) {
alert('You may only enter a Commission Percentage OR Commission Fee, not
both.');
eval('document. 'TheFormToCheck +'.'+TheFieldTo Disable+'.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
Comment