Results 1 to 6 of 6

Thread: Form that submits AND redirects

  1. #1
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Form that submits AND redirects

    I've read multiple solutions for this and not a one worked... copied EXACTLY and it doesn't work! (who's circulating this stuff?) Anyway, how do I get a form to both mailto:soandso@this.com AND redirect to a confirmation page at the same time. I had this:

    Code:
    <form name="formcheck" onsubmit="return formCheck(this);" action="emailcensored" method="post" enctype="text/plain" >
    
    ...
    
    <INPUT type=submit value="Submit Form" Onclick="document.location='thankyou.htm';">
    It worked just fine in IE, but in anything else it would just redirect before running the field validation script.

    So, I'm stumped, can anyone help? (I also have a thread going in javascript forum to see if anyone can get the validation script to redirect for me)

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You don't -- pass it through a server-side script and have the script send an HTTP redirect.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I thought of that. I don't know how to do that. Share?

    My form is importing data from a javascript run shopping cart in addtion to set page fields, so half my fields are new each time and always a different number, and i've had no luck writing anything that can move this data around for more than just direct email.

    I'm sure there are other ways, and please, do share.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It depends on what server-side languages you have available on your server.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    basically cgi/perl is all this company has access to.

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    In that case, something like:
    Code:
    #!/usr/bin/env perl
    
    # ... send your mail here ...
    
    print "Status: 303 See Other\r\n";
    print "Location: /pages/mail/confirm.html\r\n\r\n";
    Last edited by Twey; 08-15-2007 at 03:01 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •