Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help with radio redirects

    Hi all- I'm setting up a question form on my site. The form sends an email back to me. I have 2 radio buttons, and based upon which radio button the user selects, I want them to be taken to a different url. I don't have much experience with java- I think I've got the script in there but possibly in the wrong place. I'm still getting the data correctly but it's not redirecting the user to the right pages upon submission. Please help!

    Here's the basic code for the page: http://www.dudecandles.com/questions3.htm

    <html>
    <head>
    <title>Top</title>
    <p>Questions

    <form name="formname" method="post" action="http://formmail.dreamhost.com/cgi-bin/formmail.cgi" onSubmit="return FixIt();"
    <p>
    <input type=hidden name="recipient" value="info@dudecandles.com">
    <input type=hidden name="question-text" value="Question">
    <textarea name="question" cols="70" rows="6"></textarea>
    </p>
    <p>check one:</font> </p>
    <p>
    <input type="radio" name="person-type" value="badpeople" checked>
    Bad People
    <p>
    <input type="radio" name="person-type" value="goodpeople">
    Good People
    <script language="javascript">
    function FixIt() {
    if (document.formname.person-type[0].checked==true) {
    document.formname.redirect.value="http://www.dudecandles.com/thebird.htm";
    } elsif (document.formname.person-type[1].checked==true) {
    document.formname.redirect.value="http://www.dudecandles.com/thanks.htm";
    }
    }
    </script>
    <p>EMail Address (required):</font>
    <input type=text name="email" size="45">
    <input type=hidden name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT">
    <input type=hidden name="required" value="email, person-type">
    <input type=hidden name="sort" value="alphabetic">
    <input type=hidden name="print_blank_fields" value="1">
    </p>
    <p>
    <input type=submit name="submit2">

    </font> </p>
    </form>

    <body bgcolor="#FFFFFF" text="#000000">

    </body>
    </html>

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    if you are just getting an error and this is the code from your page, fix this:


    elsif (document.formname.person-type[1].checked==true) {
    document.formname.redirect.value="http://www.dudecandles.com/thanks.htm";
    }

    else if - then it should work.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #3
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the help! I did fix that and it didn't work. It's actually taking me back to my hosting provider's default submission.

    When I was just using a single page, this was the code I used and it worked fine. Do I need to do some variation of this?

    <input type=hidden name="redirect" value="http://www.dudecandles.com/thanks.htm">


  •  

    Posting Permissions

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