Skip to:
Content
Pages
Categories
Search
Top
Bottom

Double Posts

  • When a post creator hits “Send Post” and if there is a unexpectedly slow response because of a temporary stall, slow pipe or outage and they click on “Send Post” a second time……viola…..double post.

    Is there an easy fix to prevent the double post from occurring?

Viewing 3 replies - 1 through 3 (of 3 total)

  • chrishajer
    Participant

    @chrishajer

    You know, there was a post here a year or more ago about using javascript to prevent duplicate form submissions, but I can’t find it right now. I did find some results with google though, just not at this site.

    http://www.google.com/search?q=prevent+duplicate+form+submission+javascript

    The solution posted here at bbpress.org was similar to this one (at the end):

    http://www.ahfb2000.com/webmaster_help_desk/showpost.php?s=95582078bfca56f52bafd97c9de84643&p=12854&postcount=2

    Hi,

    I’m using 1.0 alpha 2 and had the same issue and used this to disable the the button and change it’s label/value after submission.

    On the edit form, replace:

    <input type=”submit” id=”postformsub” name=”Submit” value=”<?php echo attribute_escape( __(‘Post Message’) ); ?>” tabindex=”4″ />

    with

    <input type=hidden id=hidden1><input type=”submit” id=”postformsub” onclick=”this.disabled=true;hidden1.name=this.name;hidden1.value=this.value;this.value=’Please Wait…’;this.form.submit();” name=”Submit” value=”<?php echo attribute_escape( __(‘Post Message’) ); ?>” tabindex=”4″>

    This creates a hidden form field which the submit buttonvalues are passed to before it’s disabled, as when it’s disbaled it won;t work as a submit button.

    I hope that helps.

    I similar thing can created on on the edit form.

    Bharat

    the WITH replace code does not seem to appear corectly – I think because it had not spaces. here it is again:

    <input type=hidden id=hidden1><input type=”submit” id=”postformsub” onclick=”this.disabled=true; hidden1.name=this.name; hidden1.value=this.value; this.value=’Please Wait…’; this.form.submit();” name=”Submit” value=”<?php echo attribute_escape( __(‘Post Message’) ); ?>” tabindex=”4″>

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.