| | |
form in javascript
Thread Solved |
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 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.
<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 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.
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.
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.
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
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
![]() |
Similar Threads
- validate form with javascript (JavaScript / DHTML / AJAX)
- Inserting dynamic values into Javascript variables (JavaScript / DHTML / AJAX)
- return a value to php form (PHP)
- Hyperlink POST using Javascript (JavaScript / DHTML / AJAX)
- Is it possible to submit form values using JavaScript? How? (JavaScript / DHTML / AJAX)
- making my first form in dreamweaver (Site Layout and Usability)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: HELP needed on javascript menus PLEASE...
- Next Thread: Unicode Handling
Views: 1522 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxcode ajaxjspservlets array asp.net automatically blackjack box bug calendar captchaformproblem content cookies css debug debugger design detect developer disablefirebug div dom draganddrop element error explorer ext file firefox flash focus font form forms function getselection google gxt hide hijack html iframe images insertbefore internet java javascript javascripthelp2020 javascripts jquery js list maps marquee media mimic modal mp3 mysql offline onclick onerror onmouseover parameters pass passing paypal php player popup position post print programming prototype regex resize script scroll search select selection servlet session shopping show size sorting synchronous text tweet values variables video web webservice website window xml xspf






