Help! How to Redirect to a thank you page?

Discussion in 'JavaScript' started by kearra, Sep 23, 2011.

  1. #1
    Hello everyone...
    Here is my code: This is not the complete code, i just posted the important codes.
    I want a redirect code that when users click on the submit button they will be redirected to a thank you page. Example: thankyou.htm but the problem is i dont know the code and i dont know where to add the code...
    I really need the code for redirecting my user to the thankyou.htm page... Please help me... Thank You!


    <form accept-charset="UTF-8" action="http://examplepage.com" class="new_entry" id="frmNew" method="post" name="frmNew">


    <tr>
    <td class="fw-editor-label">Categories:</td>

    <td>
    <select id="entry_category_1" name="entry[category_1]" style="width: 175px">
    <option value="">-Select a Category-</option>
    <option value="1183433">example 1</option>
    <option value="1183434">example 2</option>
    </select>
    </td>
    </tr>
    </table>


    <tr>
    <td class="fw-editor-label">WEBSITE URL:</td>
    <td><input maxlength="40" size="40" id="entryBody" name="entry[body]" type="text"></td>
    </tr>


    <input id="entry_do_save_categories" name="entry[do_save_categories]" type="hidden" value="1">
    <input id="entry_draft" name="entry[draft]" type="hidden" value="false">
    <input id="entry_pending_approval" name="entry[pending_approval]" type="hidden" value="false">
    <input id="page" name="page" type="hidden">

    <div style="margin-top: 10px;">
    <input type="submit" class="fw-input-big fw-button" onclick="document.getElementById('entry_draft').value=0; document.forms['frmNew'].submit();return false;" value="Submit" />
    <input type="button" class="fw-input-big fw-button" onclick="document.location='http://examplepage.com/1.htm'; return false;" value="Cancel"/>
    </div>
    </form>
     
    kearra, Sep 23, 2011 IP
  2. amasran

    amasran Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think that Aweber does that automatically. I am not such a techie myself but I learned a lot to accomplish that now. whenever I create an Html page I use a WYSIWYG program that easies it all up for me. i don't need to stumple upon too much coding. The more you easy it up the less time you will spend on it. You can use webbuilder 7.0 Then you can easily create the thank you page or any other program and you can put the order from the home page to the thank you page, or any other page that you would like to build in . NVU for example. The less time you spent on it the more time you would have on other things like linkbuilding etc.
     
    amasran, Sep 23, 2011 IP
  3. kearra

    kearra Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Amasran but i really dont need that stuff right now. All the codes are working right on my site i just want the redirect code.
     
    kearra, Sep 23, 2011 IP
  4. webbdesigner

    webbdesigner Guest

    Messages:
    25
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    First: never use a cancel button in forms. You don't need it and visitors will click it accidently. About your problem: let the page that handles the form show a thankyou message.
     
    webbdesigner, Sep 24, 2011 IP
    aidanriley629 likes this.
  5. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #5
    Since you have no action item in the form header, and no onSubmit code showing, we don't know whether the form self-submits (submits to the page the form is on) or some other code. But. as webdesigner says, I'd do the redirect on the page you're submitting to. If the submit works, thank the user. If not, post some relevant error message.
     
    Rukbat, Sep 26, 2011 IP
  6. SheetalCreation

    SheetalCreation Peon

    Messages:
    42
    Likes Received:
    1
    Best Answers:
    3
    Trophy Points:
    0
    #6
    Hi Kearra,

    There is no submit button in your code. How are you trying to submit your page?
    Usually we have a submit button in form and we associate some action on submitting form, in that action you can redirect to user to Thank you page.

    code will look like following :
    <form action="thanksyou.php" method="post">
    // form content
    <input type="submit" value="submit" name="submit"/>
    </form>
    So whenever user will click on submit button, action associated with form will execute, in our case its thanksyou.php file. In this file you can write your thanks you message for user.
    Other than submit button we have other ways also to submit the form. but first you should try this, if codes work for this you can switch to other method.
    Let me know if you need any further help :)

    Regards,
    Sheetal
     
    SheetalCreation, Sep 27, 2011 IP
    Raj Kumar likes this.
  7. developer.designer

    developer.designer Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    input type="submit" onclick="window.location='thankyou.htm'" value="submit">
     
    developer.designer, Oct 8, 2011 IP
  8. vivian41039

    vivian41039 Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #8
    Hey Kearra,
    you should use following line instead of your <form....
    <form accept-charset="UTF-8" action="http://examplepage.com/thankyou.htm" class="new_entry" id="frmNew" method="post" name="frmNew">
     
    vivian41039, Jun 28, 2013 IP
  9. aidanriley629

    aidanriley629 Banned

    Messages:
    429
    Likes Received:
    23
    Best Answers:
    3
    Trophy Points:
    175
    #9
    Gah. Thank you. Gotta love filling out a form with thirty fields then hitting "Clear" or something similar, haha.
     
    aidanriley629, Jul 1, 2013 IP