/    Sign up×
Community /Pin to ProfileBookmark

How do you disable a button action

Hi folks, I’m new on this forum but not new to forums.

My question is that I have a friend whose website takes orders and the payments are processed by either Pay Pal or Nochex. The problem is that sometimes the customer is pressing the confirm payment button twice and this creates a situation that the customer gets debited twice for one transaction. Is it possible to disable the button from being pressed again untill the payment has been accepted or declined?

Site was developed using Dreamweaver MX 2004 and PHP.

Any help would be appreciated.

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@MstrBobOct 11.2004 — Though it might be possible to disable it with some javascript, it's a very un-userfriendly feature. Generally, the rule of thumb is simply to include a little message, "Click submit only Once.".
Copy linkTweet thisAlerts:
@PheasantauthorOct 11.2004 — Thanks for that but we have tried that and the problem still persists, although the amount of instances have reduced slightly.
Copy linkTweet thisAlerts:
@MstrBobOct 11.2004 — Well, if you must, simply add this attribute to your submit button:

<i>
</i>onclick="this.disabled='disabled'"


So a submit button would look like this:

<i>
</i>&lt;button type="submit" onclick="this.disabled='disabled'"&gt;Submit&lt;/button&gt;
Copy linkTweet thisAlerts:
@PheasantauthorOct 12.2004 — Thanks very much for that I will give it a try and let you know the outcome.
×

Success!

Help @Pheasant 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.4,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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