HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Submit form How to?
Post new topic   Reply to topic    HTML Help Forum -> HTML Form
View previous topic :: View next topic  
Author Message
scottmajor1



Joined: 18 Oct 2004
Posts: 4
Location: Canada

PostPosted: Mon Oct 18, 2004 9:46 am     Submit form How to? Reply with quote

Question Question Question Question Question

I'm tring to make a survey form on a site with a submit button:

Like this

name:
phone:
email:

submit button

I've been able to create the form itself with no problem, but now I need to find out what is the code for the submit button to work, what I mean is that the information that people have filled in be sent to a specific email address. It is of no importance that the email when received be "fancy" it simply needs to be a little like this

name=John Doe
phone=800-555-1234
email=jdoeatsomething.com

The code needs to be html and not asp.

Thanks

Scott
nagasree



Joined: 21 Sep 2004
Posts: 82
Location: Hyderabad, India

PostPosted: Mon Oct 18, 2004 11:13 pm     Reply with quote

Try this out
Code:

<HTML>
<HEAD>
<TITLE>HTML Mail </TITLE>
</HEAD>

<script language="javascript">
   function SendEmail(frm){
     var emailAddress="xxxatyy.com"
    var message = "Name:" + frm.txtName.value + "\n";
    message = message +"Phone:" +  frm.txtPhone.value;
    message = message +"\nEmail:" + frm.txtEmail.value;
    document.location.href = "mailto:"+emailAddress+"?subject=Test Mail&body="+escape(message);
   }
</script>

<BODY>
<form name="frmSendEmail" >
<TABLE>
<TR>
<TD vAlign=center align=right width="35%">
Name:
</TD>
<TD width="65%"><input type=text name=txtName value=""></TD></TR>
<TR>
<TD vAlign=center align=right width="35%">
Phone:
</TD>
<TD width="65%"><input type=text name=txtPhone value=""></TD></TR>
<TR>
<TD vAlign=center align=right width="35%">
Email:
</TD>
<TD width="65%"><input type=text name=txtEmail value=""></TD></TR>
<TR><TD vAlign=center align=center width="100%" colspan=2>
<INPUT TYPE="button" name="sendEmail" Value="Send Email" onclick="SendEmail(this.form)">
</TD></TR>
</TABLE>
</form>
</BODY>


-Nagasree
scottmajor1



Joined: 18 Oct 2004
Posts: 4
Location: Canada

PostPosted: Wed Oct 20, 2004 12:23 pm     Reply with quote

I tried this code, it perfect but I don't see where I can input an email address so that when the user types in his information that it is sent to my email.

Thanks

Scott


nagasree wrote:
Try this out
Code:

<HTML>
<HEAD>
<TITLE>HTML Mail </TITLE>
</HEAD>

<script language="javascript">
   function SendEmail(frm){
     var emailAddress="xxxatyy.com"
    var message = "Name:" + frm.txtName.value + "\n";
    message = message +"Phone:" +  frm.txtPhone.value;
    message = message +"\nEmail:" + frm.txtEmail.value;
    document.location.href = "mailto:"+emailAddress+"?subject=Test Mail&body="+escape(message);
   }
</script>

<BODY>
<form name="frmSendEmail" >
<TABLE>
<TR>
<TD vAlign=center align=right width="35%">
Name:
</TD>
<TD width="65%"><input type=text name=txtName value=""></TD></TR>
<TR>
<TD vAlign=center align=right width="35%">
Phone:
</TD>
<TD width="65%"><input type=text name=txtPhone value=""></TD></TR>
<TR>
<TD vAlign=center align=right width="35%">
Email:
</TD>
<TD width="65%"><input type=text name=txtEmail value=""></TD></TR>
<TR><TD vAlign=center align=center width="100%" colspan=2>
<INPUT TYPE="button" name="sendEmail" Value="Send Email" onclick="SendEmail(this.form)">
</TD></TR>
</TABLE>
</form>
</BODY>


-Nagasree
orbital



Joined: 11 Oct 2004
Posts: 8

PostPosted: Wed Oct 20, 2004 10:28 pm     Reply with quote

wouldnt you replace your email instead of this one

Code:
xxxatyy.com
Html [newb]



Joined: 17 Dec 2004
Posts: 3

PostPosted: Fri Dec 17, 2004 3:30 pm     AWSOME Reply with quote

soo, thanks man, it helped me too. But.....
What does that javascript jiberish mean...
where did u learn it..i would like to learn some java script
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> HTML Form All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial