Jump to content

Very unsual form error with radio inputs


basicxman

Recommended Posts

Now I have the feeling this is something completely obvious and I'm going to kick myself for not knowing this but here goes:echo '<form action="rate.php" method="post">';echo "<input type='hidden' name='title' value='$a' />";echo '<input type="radio" name="yes" value="agree" checked="checked" />Agree <br /><input type="radio" name="no" value="disagree" />Disagree';echo '<input type="submit" value="Submit" />';echo '</form>';that code works perfectly except for one problem, both radio buttons can be clicked at the same time...any idea on how to fix? is it the fact that I'm using echo to generate the radio buttons?thanks in advanced

Link to comment
Share on other sites

Give them the same name attribute.

echo '<input type="radio" name="agreement" value="yes" checked="checked" />Agree <br /><input type="radio" name="agreement" value="no" />Disagree';

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...