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
Solved

Simple guestbook

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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-…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

837 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