Jump to content

Post button problems


Recommended Posts

Earlier today I added some Javascript to every page which disabled the "Add Reply" button once it was clicked in an attempt to stamp out double posting around these parts. Unfortunately, I neglected to check the code for cross-browser compatibility, and it seems that in some browsers it just disabled the element and did nothing further.

I've removed the code for now, I may come up with something else later. Apologies to all those affected.

Link to comment
Share on other sites

It would be quite easy to make a lock in php which disables requests to post for a limited period of time.

Eg.

Poster clicks button

Check lock file

If lock file is still valid, do nothing

If lock file is not existant or no longer valid, create (new) lock file (either in memory or on disc) with date and time of post and allow the new post to be created

You may know a more efficient way of doing this...

Link to comment
Share on other sites

Sounds a bit complicated, especially since it would have to be integrated with the board's codebase. Much simpler to do something like this with Javascript from the client side.

Anyway, I've redone the code. This time it should work in all popular browsers at the very least (tested in Firefox, IE and Opera). For the changes on the full Add Reply page to take effect, users may need to restart their browser, or failing that, empty their cache. If anyone experiences problems, please let me know.

Link to comment
Share on other sites

Let's now test accidental multiple posting.

Edit: Yep, seems to work. I pressed the button about ten times before the topic page loaded with the new reply.

Edit2: I'm using Firefox 1.5.0.3 on Linux, if that info is useful to know...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...