PDA

View Full Version : Add an alert after subscribe is pushed


andrew1234
10-24-2002, 10:15 AM
Hi
If you copy the below script into a blank html page.

How do i make it so that after you push the subscribe button
an alert message pops up on the screen
alert("sent");
but only after the subscribe button is pushed

can you please help( i'm not sure how to do this)

thanks

andrew







<HTML><HEAD><TITLE>test form</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT>
<!--
function before_submit()
{
//put the text area valiable here------------------------------------------------------------------------------------------------------------------------------------------
document.forms[0].name_f.value
document.forms[0].answer.value

//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


//who ithe email is going to and the subject---------------------------------------------------------------------------------------------------------------------------------------
update_form.action = "mailto:me@test.com?subject=test form"
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
return true


}
// -->
</SCRIPT>


</HEAD>
<BODY >


<!--send form to the above function-->
<FORM name=update_form onsubmit=" return before_submit()" method=post encType=text/plain>

First Name: <INPUT size=30 name=name_f><br>
ns: <INPUT size=30 name=answer>

<br>
<INPUT type=submit value="subscribe">
</FORM>


</BODY>
</HTML>

Mhtml
10-24-2002, 11:14 AM
Quite simple, in your <input type="submit"> tag place

onClick="window.alert('Sent')"

But if you wish the user not to be able to keep clicking and making the alert keep coming up because it's not good for their mental (although if they are doing this they are clinicaly insane)

Place this in:

onClick="window.alert('Sent');this.disabled=true;this.value='Sent'"

I believe that the above will add a nice effect. As the button not only becomes disabled but the value changes to Sent.

andrew1234
10-24-2002, 02:26 PM
thanks
for the help

the second one is perfect.
only thing is it does not send the e-mail
thanks you so much

andrew