Jump to content

Stopping Multiple Clicks on Submit


newburcj

Recommended Posts

I have an email form on my website that allows a patron to make reservations to our community theatre shows using php and FormToGo. It works great but sometimes because of a slow connection, the patron will click 'Submit' and it seems like nothing happened. So they click again, and maybe again. In one case the data was submitted seven times.

 

Is there anyway I can disable the Submit button after it has been clicked once? This question has probably been answered before and I'd appreciate a point in the right direction.

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/148731-stopping-multiple-clicks-on-submit/
Share on other sites

Another way is to use sessions to remember the last time the user clicked.  Then only allow them to click once every 60 seconds (for example).  This is simple to implement and effective for most situations.

 

You do need to make sure the user can tell that the reservation was accepted though.  Perhaps send them to a list of their reservations if they have their click rejected due to repeats.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.