/    Sign up×
Community /Pin to ProfileBookmark

Disabling the submit button (for good)

Hello,
My problem is this: I have a form which, upon submission, sends the user to a different page where he is sent an email message (using php). Now, if afterwards the user clicks the back button and then clicks submit on the form again he again receives the same email message. This is what I would like to avoid. My idea was to disable the submit button upon submission but once the user is forwarded to a different page and then comes back to the original form page, the submit button is enabled again. Is there a way to disable the submit button permanently after submission so the form can be submitted only once? Does anyone have a better solution?

Thanks in advance,
Aviv.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@dr_johnJun 14.2004 — You could take the user to a different page, or re-draw the page minus the form, and show them what they have just been sent. Called a feedback page. Then on this feedback page you have a big obvious link that says "To return to page X click here" And that reloads the page as a fresh blank form. Or a variation of this of some sort to suit exactly what you need.
Copy linkTweet thisAlerts:
@avivgurauthorJun 14.2004 — The problem is this: first of all, my form has only a submit button - so reloading the form fresh would mean just reloading the enabled button and then the user could reclick it and that's what I'm trying to avoid. (the reason it only has a submit button is that it is a product of a previous form and it only asks the user to confirm his details)

Secondly, it might be easier to solve the problem by making the whole form into one document that dynamically updates to reflect the changes and then perhaps disabling the submit button would be permanent but this seems to me to be a 180 degree turn in my already complete form architecture.

Any other suggestions?
Copy linkTweet thisAlerts:
@dr_johnJun 14.2004 — Activate the allow email link in your profile and I'll send you an url that does what I mean. As it is under development for a client and posts email to them, I can't post it here, but I will tell you how to alter it to post the result to yourself. Then you can experiment a bit with some of the things it does. I got it from a book and combined it with another script to get a better overall result (although it has one little annoying problem). But it might help you.
Copy linkTweet thisAlerts:
@avivgurauthorJun 14.2004 — I'm a little new to this forum and I couldn't find out how to access my profile and "allow email link". I don't suppose you can point that out to me too?

Thanks alot for your help,

Aviv.
Copy linkTweet thisAlerts:
@dr_johnJun 14.2004 — Embarrassingly, that makes two of us!

But if you click on the profile buttom or the PM button next to my post, you can private message me your email and I can send it on that way. hope this helps.

Just found it! It's user cp at the top of the page. Silly me, looking for Profile as in other forums.
×

Success!

Help @avivgur spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...