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 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2008
    Location
    Boston, MA
    Posts
    24
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Refreshing "OnChange" Event Handler


    This is my first posting here and it seems to be a popular and knowledgeable message board.
    I wrote a unit conversion program about 10 years ago and have updated it so that the dropdown menu (feet, inches, meters, yards, etc) has an event handler that starts the conversion process without the need to click a "calculate" button. It's located here: http://www.1728.com/convert9.htm

    So, for example, if you want to convert 100 feet, you type in 100, click on "feet" and then all the conversions are calculated. If your next conversion is anything but feet, it will initiate conversions just fine. However, if you want to convert 90 feet, the event handler does nothing. I could add an auxilliary calculate button but is there a neater way to update the event handler so that clicking feet again will initiate the event?

  • #2
    Regular Coder ninnypants's Avatar
    Join Date
    Apr 2008
    Location
    Utah
    Posts
    504
    Thanks
    10
    Thanked 47 Times in 47 Posts
    Try using an on change on both the text box and your select that way it will update if the value in the text box and if they want it in something else then it will update to that once they change the type of mesurement

  • Users who have thanked ninnypants for this post:

    wolf1728 (08-24-2008)

  • #3
    New Coder
    Join Date
    Aug 2008
    Location
    Boston, MA
    Posts
    24
    Thanks
    9
    Thanked 0 Times in 0 Posts
    ninnypants
    That seems to have worked. I'll keep the changes offline for the moment but thanks very much for the help.


  •  

    Posting Permissions

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