Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Simple guestbook

Posted on 2004-04-10
3
Medium Priority
?
1,293 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

609 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