Gossamer Forum
Home : General : Internet Technologies :

Javascript: Help.

Quote Reply
Javascript: Help.
Hi,

I am making some code so that a user can type in his email address, and it sends it using his own email client to an address. Need to do this in javascript. I have made the code that opens up the clients email address and can fill in the things, the part I am having problem with is getting the pop-up messages from javascript.

How do I:

1) Get a message to pop up saying "Do you wish to have information emailed to you:" Yes / No

2) If Yes, "Please type in your email address" and have a text field there.

3) Store that input as a variable in JS so I can pass it to the code I have already.

Thanks In Advance Smile
Cheers,
Michael Bray
Quote Reply
Re: [Michael_Bray] Javascript: Help. In reply to
var answer = confirm("Yay or nay?");

if (answer) {
var email = prompt("Your email is:");
...
else
alert("Ugh");

Last edited by:

Paul: Apr 30, 2002, 8:11 AM
Quote Reply
Re: [Paul] Javascript: Help. In reply to
Thanks Paul! Thats the script below. Realised after I posted I wouldn't need them to give there email address, cause the autoresponder grabs it from the address the email came from.

Code:


<SCRIPT LANGUAGE="JavaScript">

var answer = confirm("Do you wish to recieve some information from us via email?");

var emailvalue = "join-list@domain.com";

subject = "Autoresponder Signup";
body = "This email will automatically sign you up to our Autoresponder. We will not sell your email address to anybody.";

if (answer){
window.location = "mailto:"+emailvalue+"?subject="+subject+"&body="+body;
}

</SCRIPT>
Cheers,
Michael Bray