SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2000
    Location
    France
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm Sure it's a simple question, but how do I redirect to another page after the submit button is pressed?? Thanks in advance

  2. #2
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your using formail try adding the following to the form:
    Code:
    <input type=hidden name="redirect" value="http://www.yourdomain.com/thanks.html">
    I'm not entirely sure if this works on all forms.

    Maybe someone else can give you more help

    rgds,

  3. #3
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, the ACTION attribute usually does this. For example:
    Code:
    <FORM ACTION="submittedpage.asp" NAME="1">
    The above code redirects the form to a 'submittedpage.asp' file, which would do the form processing. It can be redefined just as easily to use an HTML page, and can actually be quite simple.

    Now, did you want it this way? or do you want it to submit after you're done processing any information you collect? If you just want to display the information, use the above code.

    Post back here if you have any questions.
    Hope this helps!
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2000
    Location
    France
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Keith's solution doesn't seem to work. I just want to simply submit the info to an email address and then automatically redirect to another page, without using any cgi. Thanks!

  5. #5
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If ASP is an option, it's simple. Let me know if it's a possibility. It takes hmm...two lines of code? about 50 if you want a REALLY nice e-mail and good redirect.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  6. #6
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    Well, your form is being proccessed by a server-side language (most likely), so your best bet would be to redirect from there. However, you can do it in JavaScript. Basically, you'd use a setTimeout() witht he onsubmit event handler like:

    Code:
    <form onsubmit="setTimeout('location.href=\'someNewPage.html\'',3000)">
    aDog


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
  •