...

View Full Version : text field will not go blank onChange



Lisawynn
04-29-2004, 10:26 PM
Okay. I am still having difficulty with a script I previously posted here (http://www.codingforums.com/showthread.php?t=37609) although I have made quite a few changes to that script to get it to run correctly except for this last issue. I cannot for the life of me get the taxes and grandtotal text fields to become empty when the Total fields revert back to 0. I have tried this:



function gettaxandtotal(){
if((document.form6.printertotal.value="0")&&(document.form6.monitor.value="0")&&
(document.form6.computertotal.value="0"))
{
document.form6.taxes.value=""
document.form6.grandtotal.value=""
}
}


But that does not seem to work. I tried using an if statement which would trigger a "" value for the taxes and grandtotal text fields when the selects return to their original values but that didn't work. I am using an onChange event handler to trigger this function. I tried moving the onChange to different text fields and that is not working. I tried using onBlur but that didn't work either. Should I be using a different event handler? Everything else in the script is now working great. I don't know what I am doing wrong. Any assistance/suggestions would be appreciated. Thank you.

Kor
04-30-2004, 09:13 AM
if((document.form6.printertotal.value=="0")&&(document.form6.monitor.value=="0")&&
(document.form6.computertotal.value=="0"))

Lisawynn
04-30-2004, 04:43 PM
Thanks but still not working. I will have to play around with it some more. Thanks anyway.
:confused:

Kor
04-30-2004, 06:13 PM
maybe the error lays also in another part of the code... Have u checked?

Lisawynn
04-30-2004, 06:20 PM
Yes. I have it working now. I moved the if statement to be included in another one of the functions instead of a function on its own and it seems to be working now. That took me FOREVER to get working properly!! Thanks for your help :thumbsup: . Very much appreciated!!!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum