I'd like to set up a simple guestbook, which requires a user to enter an email address. After validating the email address, i.e. contains "@", I'd like to send a proforma email to the address entered, send another email (containing the entered address) to my webmaster and direct the user to a 'thank you' web page. [I'd like to automatically store the entered email address in a file, but I figure the email to my webmaster is a simple way to start.]
I've got as far as below, but this is incomplete (and contains errors!) - I'm struggling and need help, please.
<function check_email (form)
if (form.email.value.indexOf('@', 0) == -1)
alert ('Please enter a correct email address');
location.href = "thanks.html"
onSubmit="alert('Mail is being sent');">
Your E-Mail address:
<INPUT TYPE=text SIZE=30 NAME=email>
onclick="check_email(this.form); return false;" value="Send"