SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onchange event handling in IE

    Im struggling with an event handling issue in IE 6.0.

    Following snippet illustrates the situation:

    <input type="text" name="textfield" id="textfield" onchange="handleOnChange()"/>
    <button id="button" onchange="handleButtonClick()">button</button>

    When I change the text in the textfield and next I click on the button I would like to have both the 'handleOnChange' and 'handleButtonClick' to be executed, but only handleOnChange is executed and I have to click the button a second time to fire the 'handleButtonClick'.

    In Firefox this works fine, but in IE the onchange event prevents the execution of the onclick event.

    Does anyone know a workaround for this problem?

    Thanks,

    Edwin

  2. #2
    SitePoint Zealot logitron's Avatar
    Join Date
    Feb 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I'm not sure if this will resolve your problem, but I do know that you should probably have an "onClick" event for your button, instead of a "onChange".
    Patrick Smith
    PHP Programmer

  3. #3
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    call the buttonclick function from the change function and the change from the click

  4. #4
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the typo, but the second event handler should be onclick off course.


Bookmarks

Posting Permissions

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