Going to a new page on submit

I’ve got my submit fuc ntions all set up for processing, validiating and mailing off the email. how do I make it go to the next stage, ie the “thank you page”? Am unsure of how i would implement this. thanks!

You should use this code:


<input type="hidden" name="resulturl" value="url_here">

Hope that works for you :).

I use the following:

<INPUT TYPE="hidden" NAME="redirect" VALUE="thankyou.html">

replace thankyou.html with your page. Depending on the form mailer you are using, and where it is located, you may have to change the page to an URL like http://www.yoursite.com/thankyou.html

I’m sorry but could you elaborate on this please?

In your form area of the HTML, put this:
<INPUT TYPE=“hidden” NAME=“redirect” VALUE=“http://www.yoursite.com/thankyou.html”>

Replace http://www.yoursite.com/thankyou.html with the location of the “Thank You” page you want to refer the person to.

If you want to use the suggestions above you need to use some kind of a redirect function after. I only know PHP so this how it could been done:

header("Location: {$_POST["redirect"]}");

See the manual for more information on header function.
If your a going to use the header: this need to be sent from the server before anything of the content is sent.

If you’re just using html (no scripting language) you need to do it this way, using the action parameter at the top of your form:

<form method="post" action="http://www.yoursite.com/thankyou.html">

You might also use the action parameter even if your using PHP. But then the code for processing, validating etc. need to be in the thankyou.php file.

Hope this help :slight_smile:

-Helge

<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<script>

<!–
function processForm(doc)
{
doc.processedForm.results.value = result_str;
doc.processedForm.Submit1.type = “Submit”;
return;
}

function getSelectedValue(selectObject)
{
return selectObject.options[selectObject.selectedIndex].value
}

function openIT(opt)
{
document.location.href = opt;
}

function validate(theform) {
if (theform.results.value==“”) {
alert(“You have not processed the data yet!”);
return false; }
else { return true; }
}

//–>
</script>
<Form name=“quickForm”>

<pre>
<INPUT id=Reset1 type=reset value=Reset name=Reset1> <input onclick=“processForm (document)” type=button value=“Process Data”>
</pre>
</Form>
<form name=“processedForm” method=“post” action="mailto:jamesber50@Adelphia.net" enctype=“text/plain” ID=“Form1” onSubmit=“return validate(this)”>
<pre>
<TEXTAREA name=results rows=10 wrap=soft cols=60></TEXTAREA>
<INPUT TYPE=“hidden” NAME=“redirect” VALUE=“http://www.yoursite.com/thankyou.html”>
<input id=Submit type=submit value=Submit name=Submit1>
</pre>
</form>
</HTML>

So how would I get this code to work?

<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<script>

<!–
function processForm(doc)
{
doc.processedForm.results.value = result_str;
doc.processedForm.Submit1.type = “Submit”;
return;
}

function getSelectedValue(selectObject)
{
return selectObject.options [selectObject.selectedIndex].value
}

function openIT(opt)
{
document.location.href = opt;
}

function validate(theform) {
if (theform.results.value==“”) {
alert(“You have not processed the data yet!”);
return false; }
else { return true; }
}

//–>
</script>
<Form name=“quickForm”>

<pre>
<INPUT id=Reset1 type=reset value=Reset name=Reset1> <input onclick=“processForm (document)” type=button value=“Process Data”>
</pre>
</Form>
<form name=“processedForm” method=“post” action="mailto:jamesber50@Adelphia.net" enctype=“text/plain” ID=“Form1” onSubmit=“return validate(this)”>
<pre>
<TEXTAREA name=results rows=10 wrap=soft cols=60></TEXTAREA>
<INPUT TYPE=“hidden” NAME=“redirect” VALUE=“http://www.yoursite.com/thankyou.html”>
<input id=Submit type=submit value=Submit name=Submit1>
</pre>
</form>
</HTML>

what are you sung to author the site?

If your using dreamweaver, add a hidden field after the submit button on the form.

Name the field - “showpage” with out the quotes and where it says value, type in the url or the thankyou form you want it to goto e.g.http://www.mysite.com/thankyou.html

Then when you sumbit it will goto this page. :slight_smile:

I’m using visual studio.net. But doesn’t this hidden field need to be called by something?