PDA

View Full Version : How to show an alert before a form submits?


jhodgski
10-14-2007, 05:56 PM
I have the following form code in my html page:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

But how can I make it so that an alert is displayed before the user is taken the paypal site?

Thanks,
James

coothead
10-14-2007, 06:25 PM
Hi there jhodgski,

try it like this...

<form action="https://www.paypal.com/cgi-bin/webscr" method="post"
onsubmit="return alert('prepare youself for a trip to paypal !!!')">

jhodgski
10-14-2007, 07:13 PM
Good work - cheers!

But I am thinking of changing the alert text to "You are about to be directed to a money-grabbing web site. We would direct you somewhere else if we knew of a decent alternative..."