View Full Version : help with radio redirects

11-12-2004, 12:09 AM
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


<form name="formname" method="post" action="http://formmail.dreamhost.com/cgi-bin/formmail.cgi" onSubmit="return FixIt();"
<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>check one:</font> </p>
<input type="radio" name="person-type" value="badpeople" checked>
Bad People
<input type="radio" name="person-type" value="goodpeople">
Good People
<script language="javascript">
function FixIt() {
if (document.formname.person-type[0].checked==true) {
} elsif (document.formname.person-type[1].checked==true) {
<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">
<input type=submit name="submit2">

</font> </p>

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


11-12-2004, 01:17 AM
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) {

else if - then it should work.

11-12-2004, 01:41 AM
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">