close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

2 e-mails when submitting twice

Thread began 7/11/2012 11:33 am by Fritz Stickers | Last modified 8/08/2012 12:26 am by Fritz Stickers | 1635 views | 12 replies |

Fritz Stickers

2 e-mails when submitting twice

When submitting the Checkout page, the order is stored in the database, the customer receives an e-mail (confirmation) and an e-mail (with the order) is sent to myself.
But when the customer clicks twice the submit button, the e-mails are also sent twice.
I added the orderID in the subject. The second e-mail counts one number more than the first e-mail. This is very confusing because the next customer will have the same OrderId as that second mail.
The order is stored in the database only once and correct.

Is there a way to solve this ?



Geert.

Universal Email 3.0.7
Asp VBScript

Sign in to reply to this post

Jason ByrnesWebAssist

use javascript to hide the submit button once it's been clicked

add the following code to the submit button tag:

onClick="this.style.visibility = 'hidden';"

Sign in to reply to this post

Fritz Stickers

Thanks, this works but the customer must hit a checkbox (I agree ...) before he confirms.
When submitting without the checkbox is hit, the button also disappears.

Then, I also have another button (link) for the customer to go to the previous page to choose another payment gateway. This one should also become invisible.

The first is in a div ID, the second in a span ID.

Sign in to reply to this post

Jason ByrnesWebAssist

use server validation to validate that the checkbox has been clicked.

use getElementById to hide the second button. for example:

onClick="this.style.visibility = 'hidden'; document.getElementById('modify').style.visibility = 'hidden'"
Sign in to reply to this post

Fritz Stickers

Hi Jason,

In attach my testpage "1_Checkout".
I don't know how to implement the "server validation to validate that the checkbox has been clicked".
Can you help me to get this work ?


Thanks in advande.
Geert.

Attached Files
Confirm.zip
Sign in to reply to this post

Jason ByrnesWebAssist

Since this checkout is posting directly to paypal, server validation cannot be used in this instance, only client side validation or spry validation can be used for this.

Sign in to reply to this post

Fritz Stickers

Paypal is just to see if the loader works. Normally the page is directed to 1_Confirm.asp.
But this is one too quick.

Sign in to reply to this post

Jason ByrnesWebAssist

seethe following thread for using server validations on a checkout page that posts to the confirm page:
showthread.php?t=21834


for your checkbox, make sure to assign it a checked value.

Sign in to reply to this post

Fritz Stickers

The alert works fine now, thanks.
But in IE the animated gif freezes. In Firefox and Chrome it moves.

Sign in to reply to this post

Jason ByrnesWebAssist

i'll need a link where i can see the problem please.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...