(HTML) redirecting to another page after form submission

Discussion in 'Software' started by ShockTroop, Apr 25, 2006.

  1. ShockTroop

    ShockTroop Specialist

    I'm sure it's simple, but I can't seem to get it to work.

    I'm trying to redirect a user to another page when they click "Send" (submit) with only HTML (I'm not exactly interested in java or anything else for the moment). I read about using a "hidden" input with a value of the URL, but I don't know where to put it. I tried before and after the "submit" input (the logical place), with no luck (does it matter where I put it?). Does it work only if I have an "action" (in this case "mailto:"), or would it still work if I left the action attribute blank? Or do I have the whole process wrong?
     
  2. Kodo

    Kodo SNATCHSQUATCH

    well if you have a form
    <form name="form1" method="post" action="yourpage.html">
    ...form fields here...
    <input type="submit" value="submit" />
    </form>

    then when they click the button, it will send them to "yourpage.html"
    is that what you're looking for?
     
  3. ShockTroop

    ShockTroop Specialist

    I tried a form inside a form using that format to both send an e-mail to the mailto address and redirect to another page. It sends the e-mail, but it doesn't redirect.
    Here's the way I have it set up:

    <form action="mailto:email@place.com" method="post">

    [form stuff]

    <form name="redirect" method="post" action="thankyou.htm">
    <input type="submit" value="Send">
    <input type="reset" value="Cancel">
    </form>

    </form>

    I have other attributes but chose not to display them.
    I'm guessing the outer command ovverrides the inner one.

    Is there a way to both mail to the e-mail and redirect? That method by itself would work, but it would only redirect to another page. Hopefully I get away with only HTML...
    Sorry, maybe I didn't explain my situation fully when I said I wanted to redirect, not mentioning that I also wanted to send an e-mail. Thanks for the tip, though!
     
  4. Kodo

    Kodo SNATCHSQUATCH

    javascript is the only way I know how to solve your problem without going into server side code.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds