?
Solved

Simple guestbook

Posted on 2004-04-10
3
Medium Priority
?
1,258 Views
Last Modified: 2012-08-13
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.

Many thanks,

Alan


<html>
<body>
<SCRIPT LANGUAGE="javascript">
<function check_email (form)
{
if (form.email.value.indexOf('@', 0) == -1)
alert ('Please enter a correct email address');
}
{
location.href = "thanks.html"
}
>
</script>
<FORM NAME="EForm" method="POST" action="mailto:javascript@mydesktop.com"
onSubmit="alert('Mail is being sent');">

Your E-Mail address:
<INPUT TYPE=text SIZE=30 NAME=email>
<input type=submit
onclick="check_email(this.form); return false;" value="Send"

>
</FORM>
</body>
</html>
0
Comment
Question by:abjohnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 1000 total points
ID: 10797427
You can't use Javascript to send e-mails to visitors. You would need to use a server side language like PHP or ASP/ASP.NET. Server side processing is also more appropriate for what you're doing. Using mailto: won't work unless they're using a stand-alone mail program like Outlook.
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question