www.webdeveloper.com
Results 1 to 4 of 4

Thread: Javascript onChange event

  1. #1
    Join Date
    Apr 2005
    Posts
    48

    Javascript onChange event

    Hi,

    I was wondering if anyone could help or point me in the right direction. I have two text boxes which both call the onChange event. In this they call a function which performs some calculations.
    Fixed number 1000
    Textbox one: Enter Price
    Textbox two: Percentage
    If I change textbox one the percentage is updated in textbox two. If I change the percentage in textbox two the price is updated in textbox one.

    Because Iím using the onchange event it gets stuck in a nasty loop because Iím changing the value in a textbox which has the onchange event.
    Does anyone have any ideas on how I could go about doing this?
    Thanks

  2. #2
    Join Date
    Nov 2010
    Posts
    1,084
    I'm a little confused by the logic, but my first impression is that you could use a button to call your calculate function, or maybe look at the onblur event.

    if you showed some code maybe it would be clearer what you're trying to do...

  3. #3
    Join Date
    Oct 2011
    Posts
    8
    Again, without seeing the actual code, its hard to fathom out exactly what you're trying to do, but it looks like some sort of caculator..

    adding a button to calculate is an option, or even adding a third box, which would display the output of the calculation, but would not need to call a function onchange?

  4. #4
    Join Date
    Jan 2009
    Location
    Insanity
    Posts
    1,131
    homework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles