Solved

Simple guestbook

Posted on 2004-04-10
3
1,056 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

708 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

14 Experts available now in Live!

Get 1:1 Help Now