Click to See Complete Forum and Search --> : "Thank you" page when Submit form


MattG1225
05-07-2003, 03:47 PM
I would like to have a "Thank you" page appear after a user submits their info on our feedback form. Is there a redirect code I could use once the form is submitted? Here is the current code I am using, including the URL to the current page: http://www.intelliclaim.com/Content/feedback.html

IN HEAD:
<script language="javascript">
function validateForm(){
var msg = "";
var frm = document.frm1;

if (frm.frmName.value == "") msg += "Name\n";
if (frm.frmTitle.value == "") msg += "Title\n";
if (frm.frmCompany.value == "") msg += "Company\n";
if (frm.frmAddress.value == "") msg += "Address\n";
if (frm.frmEmail.value == "") msg += "Email\n";
if (frm.frmPhone.value == "") msg += "Phone\n";
if (frm.frmHear.value == "") msg += "How did you hear about us?\n";
if (msg != "")
{
msg = "The following fields need to be filled out before submitting:\n" +
msg;
alert(msg);
return false;
}

}


</script>

IN BODY:
<FORM name="frm1" METHOD=post ENCTYPE=text/plain ACTION="mailto:gmelchio@intelliclaim.com">
Name:<br><INPUT NAME="frmName" SIZE="50"><br>
Title:<br><INPUT Name="frmTitle" SIZE="50"><br>
Company Name:<br><INPUT Name="frmCompany" SIZE="50"><br>
Mailing Address:<br><TEXTAREA name="frmAddress" rows=2
cols=38></textarea><br>
Email:<br><INPUT Name="frmEmail" SIZE="50"><br>
Phone Number:<br><INPUT Name="frmPhone" SIZE="50"><br>
How did you hear about us:<br><TEXTAREA name="frmHear" rows=3
cols=38></textarea>
<br><br>
<DIV ALIGN="center"><INPUT TYPE="submit" onclick="return validateForm()"
NAME="submit" VALUE="Submit Form"></DIV>

Tasmanian Devil
05-07-2003, 03:51 PM
try using

<input type=hidden name=redirect value="http://www.yourdomain.com/thankyou.html">

just fill in your information

MattG1225
05-07-2003, 03:56 PM
would I put that tag after the <submit> tag or in the beginning of the <form> tag?

Tasmanian Devil
05-07-2003, 03:59 PM
right after your action on the next line down

MattG1225
05-07-2003, 04:06 PM
Here's what I have (doesn't redirect, though)

<FORM name="frm1" METHOD=post ENCTYPE=text/plain ACTION="mailto:mattgooding@healthesolutions.com">
<input type=hidden name=redirect value="http://www.intelliclaim.com/Content/thankyou.html">
Name:<br><INPUT NAME="frmName" SIZE="50"><br>
Title:<br><INPUT Name="frmTitle" SIZE="50"><br>
Company Name:<br><INPUT Name="frmCompany" SIZE="50"><br>
Mailing Address:<br><TEXTAREA name="frmAddress" rows=2
cols=38></textarea><br>
Email:<br><INPUT Name="frmEmail" SIZE="50"><br>
Phone Number:<br><INPUT Name="frmPhone" SIZE="50"><br>
How did you hear about us:<br><TEXTAREA name="frmHear" rows=3
cols=38></textarea><br><br>
<DIV ALIGN="center"><INPUT TYPE="submit" onclick="return validateForm()"
NAME="submit" VALUE="Submit Form"></DIV>

Tasmanian Devil
05-07-2003, 04:16 PM
one question, why are you emailing it and not sending it to a processor and then email to you? that way you will not get the popup message saying that it the form is being emailed

Jona
05-07-2003, 04:16 PM
Okay, you're not using a script to process it, you're just mailing it to yourself, so you should try to use this:

<FORM name="frm1" METHOD=post ENCTYPE=text/plain ACTION="mailto:mattgooding@healthesolutions.com" onsubmit="location.href='thankyou.html';">

GavinPearce
05-07-2003, 04:17 PM
Nah redirect is used in cgi scripts and php and stuff like that as a variable. It won't work in HTML and JavaScript coding.

You can have a new window open after submitting, but the redirect tag given to you like i said will not work.

Gav.

MattG1225
05-08-2003, 04:09 PM
Thanks everyone for your comments. Jona, your tag works perfectly for what I wanted!!

Matt -

MattOz
05-12-2003, 11:33 AM
Hi there,

I have read this thread because I wanted to do exactly the same thing, however, it doesn't solve my problem.

While this method of redirection is OK, is still redirects the user to the thank you page if they decide to cancel the email submission.

Is anyone aware of a way to stop the ridirection if a user clicks 'Cancel' to the email submission??

Thanks,
matt

GavinPearce
05-12-2003, 11:35 AM
no sorry...


USe cgi or asp or PHP (da best 1) for forms, it loads bttr.

MattOz
05-12-2003, 11:40 AM
I had the feeling that would be the answer. The server that I am using does not support cgi and I'm assuming it won't support PHP either.

Thanks for your help.

Matt