form in javascript

Thread Solved

Join Date: Nov 2007
Posts: 119
Reputation: Roebuc is an unknown quantity at this point 
Solved Threads: 2
Roebuc's Avatar
Roebuc Roebuc is offline Offline
Junior Poster

form in javascript

 
0
  #1
Dec 17th, 2007
Ok guys, I have a form I want to email the data to my email addess. There are three inputs, two text and one text area. On submit I would like it to display a thank you page. Whenever submit is clicked, I get a script error(thank you page never shows) and the hotmail pops up. I would like the form to just send the email without a pop up and go straight to the thank you page. Here is the code:

<form id="getquote" action="maileto:me@gmail.com" method="Post" enctype="multipart/form-data" name="form1" onSubmit="return location.replace(thankyou.html)">
<table class="no_class" cellspacing="0" cellpadding="0">
<tr>
<td style="width:265px;">
<div class="form"><input type="text" name="yourname" value="your name" onFocus=value="" onblur=value="your&nbsp;name"></div>
<div class="form"><input type="text" name="email" value="e-mail" onFocus=value="" onblur=value="e-mail"></div>
</td>
<td >
<textarea rows="20" cols="50" name="message" onFocus=value="" onblur=value="message:">message:</textarea><br>
<br style="line-height:7px;">
<input type="submit" value="Get Quote!" onClick="parent.location='mailto:lancerayburn@gmail.com'; replace(thankyou.html)" style="margin-left:140px"><input type="reset" value="Reset" style="margin-left:27px"><br>
</td>
</tr>
</table>
</form>


Thanks in advance for any help.
Last edited by Roebuc; Dec 17th, 2007 at 9:42 pm.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,538
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 255
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: form in javascript

 
0
  #2
Dec 17th, 2007
Well mailto links launch the viewer's default email client. It doesn't actually send an email, you would need an emailer in PHP such as the one in the PEAR package for example if you would like an email form.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 7
Reputation: MickRip is an unknown quantity at this point 
Solved Threads: 3
MickRip's Avatar
MickRip MickRip is offline Offline
Newbie Poster

Re: form in javascript

 
0
  #3
Dec 17th, 2007
Hey Mate,

Using the mailto action isn't a good idea because it relies on the local e-mail software, which may not be set up correctly. There's no way to test for it either.

Using a server side language like PHP, or a pre-existing CGI on your hosting provider is the more robust option for a variety of reasons.

Also, may I suggest you get rid of the onblur/onfocus from your form fields, as they will get very annoying very quickly - it'll wipe the email addy if you refocus!

Regards,
Mick
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 119
Reputation: Roebuc is an unknown quantity at this point 
Solved Threads: 2
Roebuc's Avatar
Roebuc Roebuc is offline Offline
Junior Poster

Re: form in javascript

 
0
  #4
Dec 18th, 2007
I thought there was a way around php, I guess not. Alright, thank you guys.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum


Views: 1522 | Replies: 3
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC