Skip to Content
author's profile photo
Former Member

Prevent double clicking of Button event

Hi Guys,

Can any one of you help me out, how to restrict the user from preventing double clicking of the button event.Now what happens is it is posting twice the logic.

Thanks in Advance for helping me.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • author's profile photo
    Former Member
    Mar 09, 2004 at 03:11 PM

    Kumar:

    When you define the button, set the "OnClick=" event to execute a Javascript function to disable the button. Once the button is clicked the first time, it will be disabled, and the "Post" code will only run once.

    Regards,

    D.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Mar 09, 2004 at 03:20 PM

    It depends what you want to do.

    If you like to allow user just once the clikc on your button then set it inactive after first input processing.

    if you need it while your input processing is running

    then use <xhtmlb protect double submit> - you find it in your tag browser under xhtmlb elements it blocks your

    application with a "Please wait" box while your input is

    in work an give it free after that...

    Sometimes (not often) its good to look into the SAP

    samples...

    Regards Matthias

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Mar 10, 2004 at 06:52 AM

    Hi Matthias,

    Thanks for the timely help. But what i observed is when we incorporate the xhtmlb tag itself i could see the "protectDoubleSubmit" is inherited by default. So i thought we needn't need to call it explicitly.

    Hi D:

    Since the htmlb buttons basically given as a link inside in the css, i was not able to disable it after clicking.All that i was able to do is, i was have given a Hour glass icon 😊

    Thanks Guys.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Mar 18, 2004 at 12:23 PM

    Hi Kumar,

    Write this at the top of the page:


    And put this where you define the submit button: onClientClick="disableButton();"

    It will submit a form only once.

    Br

    Mikko

    Message was edited by: Mikko Mäkelä

    Add comment
    10|10000 characters needed characters exceeded