Previous Thread
Next Thread
Print Thread
Rate Thread
#215131 04/17/2002 6:19 PM
Joined: Apr 2002
Posts: 102
Journeyman
Journeyman
Offline
Joined: Apr 2002
Posts: 102
I've seen other BB software where once you have clicked the submit button it is then disabled to cut down on double posts. Just thought this would be good for those who have slower boards combined with impatient people. []/forum/images/icons/rolleyes.gif[/]

Sponsored Links
Joined: Sep 1999
Posts: 339
Kahuna
Kahuna
Offline
Joined: Sep 1999
Posts: 339
The double posts won't get entered if they are using the submit button... the post has to be different, or else it will pick it up and not allow a second post.


Muhammad
paulj #215133 04/19/2002 10:10 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I think the requested result is to keep them from sending information to the server a second time to keep the server load down. Although the duplicate post isn't entered it did use up some server time to figure that out.

This is rough but this is what I think would be needed:

Add this to the header insert include -

<script language=javascript>
var subonce = 1;
function doSub () {

if (subonce) {
subonce = 0;
document.replier.submit();
}
else {
alert('Please be patient... Thanks.');
return false;
}

}
</script>


Then replace your submit button type which should be labled "submit" with "button" and then add this to the same tag:

onClick="doSub()"



I think that should do it. I would have to actualy do it to see if it works though... lol I think it will []/forum/images/icons/wink.gif[/]

Joined: Sep 1999
Posts: 339
Kahuna
Kahuna
Offline
Joined: Sep 1999
Posts: 339
Have you tested that on netscape? I'm not sure if it will show up at all with "button" in there. []/forum/images/icons/smile.gif[/]


Muhammad
paulj #215135 04/19/2002 10:24 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
It should show up. I believe there are only 3 specific types of buttons. Submit, Reset and Button. The latter used when defining a specific function for it. []/forum/images/icons/smile.gif[/]

I'll give it a whirl and make sure though. []/forum/images/icons/smile.gif[/]

Sponsored Links
paulj #215136 04/19/2002 10:28 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Seems to be working for me... []/forum/images/icons/smile.gif[/]

Joined: Sep 1999
Posts: 339
Kahuna
Kahuna
Offline
Joined: Sep 1999
Posts: 339
Right... so long as it isn't "button" it should work... We have had problems with "button" in netscape.


Muhammad
paulj #215138 04/19/2002 10:47 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I have never had a problem using "button" with NS 4.7+ but perhaps older versions had the problem?


Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
your code looks good dave, we've had several versions of that for ubb, I'll hunt it down later []/forum/images/icons/smile.gif[/]


- Allen wavey
- What Drives You?
Joined: Sep 1999
Posts: 339
Kahuna
Kahuna
Offline
Joined: Sep 1999
Posts: 339
4.7, 6.0, both had problems. []/forum/images/icons/smile.gif[/] We changed it to submit and it worked...


Muhammad
Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks []/forum/images/icons/smile.gif[/]

I should add that the javascript is ment for 6.0 because the form tag has been given a name "replier" otherwise all affected scripts would need to be edited and name="replier" added to the form tags. []/forum/images/icons/smile.gif[/]

Joined: Apr 2002
Posts: 102
Journeyman
Journeyman
Offline
Joined: Apr 2002
Posts: 102
Great, thanks!

Joined: Oct 1999
Posts: 282
Enthusiast
Enthusiast
Offline
Joined: Oct 1999
Posts: 282
Good idea. But why not remove the button or make it invisible instead of the alert-box? Just a thought...

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
The button can't be removed till after the page is generated again so to keep a person from hitting the button more than once while the page is trying to post causes the same information to be sent twice. Using the javascript to check before sending keeps this from happening. []/forum/images/icons/smile.gif[/]

You could remove the alert box and just return the false statement. Nothing more will happen and the information will still only be submitted once. I just figured it would give the impatient people more incentive to wait... lol []/forum/images/icons/wink.gif[/]


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)