SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    ::==:: Bonzo_CS's Avatar
    Join Date
    Dec 2003
    Location
    (Cardiff Wales)
    Posts
    747
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onclick not working in IE?

    Hi Guys,

    I can't see the problem here?

    Basically I want to disable a button when clicked within a form to stop people over posting (repetative clicking).
    It seems to work fine in FF etc, but when launching this in IE it seems its disabling the element before actually allowing the button to function which then
    renders the button useless. Any Ideas?


    function disableNext()
    {
    document.getElementById('next').disabled = true;
    }

    -----

    <div style="float:right;" >

    <input id="next" type="image" name="next" src="/img/form-buttons/next.gif" onclick="disableNext()" />
    </div>
    Last edited by Bonzo_CS; Sep 20, 2006 at 08:06.

  2. #2
    ::==:: Bonzo_CS's Avatar
    Join Date
    Dec 2003
    Location
    (Cardiff Wales)
    Posts
    747
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just in case anyone is interested I managed to do a work around which suits my needs. Basically calling a delay od a second before disabling the button. This gives IE the chance to post as its supposed to before disabling.

    function disableNext()
    {

    document.getElementById('next').disabled = true;
    }

    function func1Delay()
    {
    setTimeout("disableNext()", 1000);
    }

    ______________

    <input id="next" type="image" name="next" src="/img/form-buttons/next.gif" onclick="formDirty=false; func1Delay()" />


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
  •