Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2004
    Location
    Manitoba, CANADA
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    text field will not go blank onChange

    Okay. I am still having difficulty with a script I previously posted here 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:

    Code:
    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.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    if((document.form6.printertotal.value=="0")&&(document.form6.monitor.value=="0")&&
    (document.form6.computertotal.value=="0"))
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New Coder
    Join Date
    Feb 2004
    Location
    Manitoba, CANADA
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks but still not working. I will have to play around with it some more. Thanks anyway.

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    maybe the error lays also in another part of the code... Have u checked?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    New Coder
    Join Date
    Feb 2004
    Location
    Manitoba, CANADA
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 . Very much appreciated!!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •