Sending Form Data to E-mail Address

This is a discussion on "Sending Form Data to E-mail Address" within the Starting Out section. This forum, and the thread "Sending Form Data to E-mail Address are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Starting Out

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Dec 12th, 2007, 16:29
New Member
Join Date: Jan 2007
Location: Surrey
Age: 40
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Sending Form Data to E-mail Address

Hope this is the right board for this.

I'm using Frontpage and I've designed a form using the design method not HTML. I want to be able to send the data that will be entered in the form to my e-mail address. I can't remember how to do it.

I go to "Form Properties" and select "Send To Other". Then I click on "Advanced" then in the "Advanced Form Properties" window I add the recipient, which is my e-mail address. Then I click on "Options" and this is the bit I can't remember. I know the METHOD is "POST" but I can't remember the "ACTION" bit. All I know is it's something to do with webmail-cgi........ at least that's what they told me at my course.

Can someone please help me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 21st, 2007, 10:34
Up'n'Coming Member
Join Date: May 2007
Location: Tamworth
Age: 31
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Sending Form Data to E-mail Address

Hello


Frontpage is a bitch i would try and use dreamweaver to start with. Form action will be mailto: and then the email address.

You would need to have some validation on the form i would use PHP or Java (not sure if your new to web design).

So for example you would have an HTML form and then you have a PHP or Java script associated. Thats for the advanced version.

Here is a very basic java version:-
HTML: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<title>JavaScript Form validation</title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function check() {
var nameandsurname = document.myform.nameandsurname;
var email = document.myform.email;
var age = document.myform.age;
var gender = document.myform.gender;
if ( nameandsurname.value.indexOf(" ") == -1) {
alert("Enter your Name and Surname.");
nameandsurname.focus();
} else if ((email.value.indexOf("@") == -1) || (email.value.indexOf(".") == -1)) {
alert("Enter your valid email address.");
email.focus();
} else if (! (parseInt(age.value) > 0)) {
alert("Enter your Age.");
age.focus();
} else if (gender.selectedIndex == 0) {
alert("Select your gender.");
gender.focus();
} else { 
document.myform.submit();
}
}
</SCRIPT>
</head>
<body>
<form action="mailto:info@cocoonfxmedia.co.uk" method="post" name="myform">
Name and Surname: <br/>
<input type="text" name="nameandsurname" size="30"> <br/>
Email: <br/>
<input type="text" name="email" size="30"> <br/>
Age: <br/>
<input type="text" name="age" size="3"> <br/>
Gender: <br/>
<select size="1" name="gender">
<option>- Select gender -</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
<br/>
<input type="submit" value="Submit" onClick="check();return false;">
</form>
<br/>
<b><a href="<A href="http://www.cocoonfxmedia.co.uk">Cocoonfxmedia</a></b">http://www.cocoonfxmedia.co.uk">Cocoonfxmedia</a></b>
</body>
</html>

Last edited by Marc; Dec 21st, 2007 at 12:01. Reason: Added [html] tags]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 21st, 2007, 10:52
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,322
Blog Entries: 2
Thanks: 9
Thanked 48 Times in 45 Posts
Re: Sending Form Data to E-mail Address

I wouldn't recommend using the mailto function these days. Client-side validation (Javascript) isn't reliable enough, and you need a server-side script to process the form, detect invalid inputs, and format it so that you end up a with a readable message in your inbox. Plus you might also want to redirect users after submission or warn them if it fails.

There are loads of ready made scripts out there that only require a bit of tweaking. Here's a PHP mail script, but you can use anything from Perl to ASP to do the job.

Then simply change the action variable at the top of your form to action="filename_of_script"
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 21st, 2007, 12:04
Marc's Avatar
Staff Manager

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 1,765
Thanks: 0
Thanked 14 Times in 14 Posts
Re: Sending Form Data to E-mail Address

I too wouldn't reccommend using the mailto: function - instead I would use a programming language such as PHP or ASP - aso186 pointed out a good example of a PHP Contact script.

Cocoonfx, what you described there was JavaScript, and not Java . Once again, I wouldn't reccommend using JavaScript for validation since users can disable it on their browsers.
__________________
Marc
Staff Manager - Webforumz.com


Want to be a moderator? PM me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 23rd, 2007, 14:16
Reputable Member
Join Date: Dec 2005
Location: U.S.A.
Posts: 155
Thanks: 0
Thanked 4 Times in 4 Posts
Re: Sending Form Data to E-mail Address

Although, if you serious about validation. You probably want to validate with JavaScript AND a server side language. Reason being that when you validate with a server side script the page is reloaded. When you validate and catch errors with JavaScript the page is not reloaded and you can simply highlight the fields that have errors in them.

As far as your users go, this will be easier for them without starting over everytime there is an error (especially with a large form). The reason you use both client and server side is that JavaScript can be turned off and then you can catch those errors on the server side.
__________________
Web Design and Development
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP mail() --> Making a Form / Validating Input / Sending an email c010depunkk PHP Forum 4 Jan 17th, 2008 06:35
Sending database record ID as a membership number t an email address frinkky PHP Forum 3 Nov 30th, 2006 02:45
Sending Form to E-mail student_in_training JavaScript Forum 2 Aug 16th, 2006 12:41
About sending form-data to an email address a.jenery Web Page Design 4 Mar 3rd, 2006 12:17
sending an e-mail by ASP benbacardi Classic ASP 5 Sep 1st, 2004 19:33


All times are GMT. The time now is 09:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42