Solved

Simple guestbook

Posted on 2004-04-10
3
1,126 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
3 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 250 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now