PDA

View Full Version : Resetting a form after submit


jazzyjeff
02-23-2007, 07:07 PM
Ok. I am using some forms on my website and I know the mailto: is not the greatest, but is there away to still use the mailto: command after submit and have the submit clear the form and jump to a thank you page all when the vistor clicks submit one time?

Here is a link to one of the forms.

http://www.sageadvisor.net/WANReg.htm

Thank you for any help

Jeff

jazzyjeff
02-24-2007, 02:00 PM
This has to be just a quick code that I am missing. Any help would be great as this is my last step and I can not find this answer in the forums.

Thank you,
Jeff

davidj
02-24-2007, 02:38 PM
the mailto launches an email client

is this what you want

jazzyjeff
02-24-2007, 02:41 PM
Davidj thank you for the response. The mail client works, but I also want it to redirect to a thank you page and/or reset the form after it launches the mail client.

Thanks again!!

Jeff

jazzyjeff
02-24-2007, 06:49 PM
Any one? Sorry this is the last thing I need to fix on this site

davidj
02-24-2007, 07:15 PM
run this and adapt it to suit your needs


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript" >
function mailer(){
m = document.forms[0];
m.action="mailto:nirvanadesign@msn.com?subject=WAN Evaluation";
m.submit();
document.location.href="mail.php";
}
</script>
</head>
<body>
<form method="post" enctype="text/plain" name="form1" id="form1">
<p>
<input type="text" name="textfield" />
<input type="text" name="textfield2" />
<input type="text" name="textfield3" />
</p>
<p>
<input type="checkbox" name="checkbox" value="checkbox" />
<input type="checkbox" name="checkbox2" value="checkbox" />
<input type="checkbox" name="checkbox3" value="checkbox" />
</p>
<p>
<select name="select">
<option value="fff" selected="selected">fff</option>
<option value="ggg">ggg</option>
</select>
</p>
<p>
<input type="button" name="Button" value="Button" onclick="mailer()"/>
</p>
</form>
<p>&nbsp;</p>
</body>
</html>

jazzyjeff
02-25-2007, 05:07 PM
there must be an easier way to just insert a hidden field in my form to submit via the mailto: command and redirect to another page at the same time?

Really not a big code writter.

Thanks again for the help.

Jeff

domedia
02-25-2007, 05:31 PM
there must be an easier way to just insert a hidden field in my form to submit via the mailto: command and redirect to another page at the same time?f Not as long as you want to use mailto: instead of a regular contact form. 'mailto:' does not send any info to your server, it asks the local OS to fire up the default email client.

jazzyjeff
02-25-2007, 05:51 PM
So I can not have it redirect after submit using the mailto: command?

Thank you again for the help

Jeff

domedia
02-25-2007, 06:13 PM
Correct, unless you use DJ's suggestion above and make a script that will fire both the mailto and redirect at the same time. If you're up for it, use a contact form instead.

So I can not have it redirect after submit using the mailto: command?

Thank you again for the help

Jeff

fwr1000
02-25-2007, 06:29 PM
I have used the tutorial from DW Club Forum by Ramandeep and found it quite easy to put a PHP form onto a site, along with the "thank you" redirect. Give it a try, here is the link http://www.dreamweaverclub.com/dreamweaver-php-form.php

Fred