Prevent a javascript function from executing twice

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vijay

    Prevent a javascript function from executing twice

    hi,

    I have a select dropdown and 5 text fields. based on the option
    selected (which are the units - cm/mm/inches/ft/yard etc), i change
    the values in the text fields using javascript to the corresponding
    units.

    my problem is that when the options are selected very quickly(for eg
    using the keyboard's up/down keys) then quickly, the text field values
    lose their connection with the select box and the values become
    illegal.
    I suspect that the javascript function is being called even before the
    earlier execution has not terminated.
    I tried using a global variable and using it as a lock, but still no
    success.

    What possibly am i doing wrong here?

    Thanks for any help
  • RobG

    #2
    Re: Prevent a javascript function from executing twice

    Vijay wrote:
    [...][color=blue]
    >
    > What possibly am i doing wrong here?
    >[/color]

    Without a small code sample showing the behaviour, we're just
    guessing. Can you provide a hint?

    --
    Rob

    Comment

    Working...