SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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!

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should use this code:

    Code:
    <input type="hidden" name="resulturl" value="url_here">
    Hope that works for you .

  3. #3
    busy Steelsun's Avatar
    Join Date
    Mar 2001
    Location
    Houston, Tejas; Future Capital of the World
    Posts
    2,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use the following:

    Code:
    <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
    Brian Poirier
    SunStockPhoto: Stock Photos, Fine Art Photos, Event Photography

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry but could you elaborate on this please?

  5. #5
    busy Steelsun's Avatar
    Join Date
    Mar 2001
    Location
    Houston, Tejas; Future Capital of the World
    Posts
    2,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Brian Poirier
    SunStockPhoto: Stock Photos, Fine Art Photos, Event Photography

  6. #6
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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:
    PHP Code:
    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:
    Code:
    <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

    -Helge

  7. #7
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <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>

  8. #8
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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>

  9. #9
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  10. #10
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm using visual studio.net. But doesn't this hidden field need to be called by something?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •