iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack (4) Thread Tools
Old December 24th, 2005, 01:16 PM   4 links from elsewhere to this Post. Click to view. #1
New Member
 

Join Date: Dec 2005
Age: 27
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 pagey is on a distinguished road
JavaScript 'contact us' form

Yes, I know its cheating, but does anybody have some source code handy for a form suitable on a 'Contact Us' page. Nothing too flashy required....

Or maybe a link to a tutorial that would cover my requirements?

Cheers
pagey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old January 9th, 2006, 12:32 PM   #2
New Member
 

Join Date: Jan 2006
Location: Leeuwarden, NL
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 AnneJan is on a distinguished road
Exclamation Re: JavaScript 'contact us' form

Here's a code that might help:

HTML Code:
<html>
<head>

<title></title>

</head>

<body>
 <center>
                <tr>
                  <td><form method="post"action="#?">
                    <input type="hidden" name="require" value="email">
                    <input type="hidden" name="recipient" value="user@provider.com">
                    <input type="hidden" name="sort" value="alphabetic">
                    <input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT">
                    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="15">&nbsp;</td>
                      <td><table width="98%"  border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td height="25">&nbsp;</td>
                              <td>&nbsp;</td>
                              <td>&nbsp;</td>
                            </tr>
                            <tr>
                              <td height="25" class="txt_content_bold">Reason for Contact<br></td>
                              <td width="15"> <div align="center">: </div></td>
                              <td><select name="multi_field[]" size="3" multiple class="select01">
                                  <option value="Problem">Problems</option>
                                  <option value="Something">Something</option>
                                  <option value="Help me">Help me</option>
                                  <option value="Also Something">Also Something</option>
                                </select></td>
                            </tr>
                            <tr>
                              <td height="25" class="txt_content_bold">Message Subject </td>
                              <td><div align="center">:</div></td>
                              <td><input name="subject" type="text" class="input02"></td>
                            </tr>
                            <tr>
                              <td height="25" class="txt_content_bold">Your Email </td>
                              <td><div align="center">:</div></td>
                              <td><input name="email" type="text" class="input02"></td>
                            </tr>
                            <tr>
                              <td height="25" valign="top" class="txt_content_bold">Please enter your message</td>
                              <td valign="top"><div align="center">:</div></td>
                              <td><textarea name="message" rows="8" class="input02"></textarea></td>
                            </tr>
                            <tr>
                              <td height="50" valign="top">&nbsp;</td>
                              <td valign="top">&nbsp;</td>
                              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                //submit.gif: Place a button to send this to you  
				<td width="142"><input type="image" src="Submit.gif"></td>
                                  <td><input type="image" src="Reset Message.gif" onclick="this.form.reset(); return false"></td>
                                </tr>
                              </table>

</center>
</body>
</html>
AnneJan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 16th, 2008, 05:43 AM   #3
New Member
 

Join Date: Dec 2008
Location: England
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 noorhanabbas is on a distinguished road
Re: JavaScript 'contact us' form

Hello,
I tried to use the code. It seems it posts the emails fine from the 'Contact us' form but I couldn't receive the posted emails?

Any idea why this is happening?

Thanks.
noorhanabbas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 16th, 2008, 06:17 AM   #4
Highly Reputable Member
 

Join Date: Mar 2008
Location: Chester, UK
Age: 18
Posts: 563
Thanks: 2
Thanked 41 Times in 41 Posts
Rep Altering Power: 0 Bocaj is on a distinguished road
Re: JavaScript 'contact us' form

What did you alter on the script?
Bocaj is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 16th, 2008, 08:02 AM   #5
New Member
 

Join Date: Dec 2008
Location: England
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 noorhanabbas is on a distinguished road
Re: JavaScript 'contact us' form

I added a function that checks on the email address supplied by the user, then the form will use the 'Post' method and action="#?"
Posting the email seems to be okay...as I get HTTP 1.1-200 message after the posting. But I don't really get the email sent.

Thank you very much
noorhanabbas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 16th, 2008, 09:21 AM   #6
New Member
 

Join Date: Dec 2008
Location: England
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 noorhanabbas is on a distinguished road
Re: JavaScript 'contact us' form

Just a thought that came to me....is it right to write the recipient email address in the action field of the form action="#provider@whatever.com"

Please help,
Thanks.
noorhanabbas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 20th, 2009, 05:24 PM   #7
New Member
 

Join Date: Apr 2009
Location: uk
Age: 100
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 bennyben is on a distinguished road
Re: JavaScript 'contact us' form

The script posted above will not send any email, it is just a form with no destination. You need to have a Server-side script to take the form POST information and sent the email.

First you need to specify the Server script as the forms 'action' parameter, for example:

Code:
<form name="contact" method="post" action="sendform.php">
The you need to create the form processing script 'sendform.php' and save it to your Server.

A simple example would be:

Code:
<?php
$message = "";
foreach($_POST as $a => $b) {
 $message .= $a." : ".$b."\n";
}
mail("you@domain.com","Form Submission",$message);
?>
Note that the above is the most basic code example possible, you really should add some additional validation checks etc... but it should give some food for thought.
bennyben is offline  
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

Bookmarks

Tags
javascript , contact , form


LinkBacks (?)
LinkBack to this Thread: http://webforumz.com/javascript/4552-javascript-contact-us-form.htm
Posted By For Type Date
javascript email form - Zuula Search This thread Refback November 12th, 2008 07:55 PM
Need A Contact Form This thread Refback May 5th, 2008 11:44 AM
Need A Contact Form This thread Refback November 11th, 2007 03:40 PM
Need A Contact Form This thread Refback August 31st, 2007 02:51 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
[SOLVED] PHP contact form redirect to same form Posie PHP 14 January 29th, 2008 04:28 PM
help with asp contact form? Ella Classic ASP 4 January 1st, 2008 08:45 PM
what is the best contact form Phixon HTML, XHTML and CSS 10 May 15th, 2007 02:47 PM
Contact us form help! NurseJenny PHP 10 June 23rd, 2006 09:27 AM
Need Quote Form and Contact Form Av8er Flash and ActionScript 5 October 30th, 2003 01:14 PM


Search Engine Optimization by vBSEO 3.2.0 RC8