jones_bones
asked on
PHP radio buttons problem
Hi all,
I have a problem with this script whereby when the continue button is pressed the page visually scans through the radio buttons options and rests on the last option always before going onto the next screen. This can be confusing for users if they selected option a and it looks like they have selected option c.
See this page for visual :
http://www.whatyouseeyoucannotbe.com/inves/freewill/tester.php
I know the php code at the top checks to see what option is selected and sends the user to the appropiate page but I don't want the user to see this scan visually.
Thanks,
D
I have a problem with this script whereby when the continue button is pressed the page visually scans through the radio buttons options and rests on the last option always before going onto the next screen. This can be confusing for users if they selected option a and it looks like they have selected option c.
See this page for visual :
http://www.whatyouseeyoucannotbe.com/inves/freewill/tester.php
I know the php code at the top checks to see what option is selected and sends the user to the appropiate page but I don't want the user to see this scan visually.
Thanks,
D
<?php
if(isset($_POST['go'])){
$pagetogo = $_POST['radio'];
if($pagetogo == 1){
header("Location: fwq.php");
exit;
}
if($pagetogo == 2){
header("Location: page2.php");
exit;
}
if($pagetogo == 3){
header("Location: fwz.php");
exit;
}
}
?>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="radio" name="radio" id="radio" value="1" />
</label>
Yes <br />
<label>
<input type="radio" name="radio" id="radio2" value="2" />
</label>
Some<br />
<label>
<input name="radio" type="radio" id="radio3" value="3">
No,<br>
<br>
<br>
<input type="submit" name="go" id="submit" value="Continue" />
</label>
</form>
ASKER
Okay thanks,
Yup I only set that one up as a test page. Yes, I've checked it now in IE alright and it works fine just not in FF. Same old story I guess :) Don't know, is there much I can do about it or can anyone think of a different way to arrange the code so that this problem does not occur?
Thanks,
D
Yup I only set that one up as a test page. Yes, I've checked it now in IE alright and it works fine just not in FF. Same old story I guess :) Don't know, is there much I can do about it or can anyone think of a different way to arrange the code so that this problem does not occur?
Thanks,
D
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent! Thanks for spotting that!
You will be happy to know that I don't see this behaviour on IE6 WinXP. Must be a browser issue. What I see is that whatever I clicked remains clicked until redirected.
BTW: Choosing Maybe takes me to page not found