Checked? in a Dynamic Radio Group
Hello:
What is working:
Dynamically generated a radio group using PHP and MySQL (with Dreamweaver built in Record Set and a loop).
What I can't get done:
How can I determine which radio button has been checked by the user?
What I have tried:
Googleing this thing to death.
I found a site that uses a checked status type thing, but that assumed the values were hard coded. I would like to maintain dynamic values if possible. Also, I realize some (maybe all:) of the php below may not be well formed . . . I am trying to learn how to use Dreamweaver's built in functionality and the generated code is throwing me a bit.
Here is my current Form code:
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1" id="form1">
<?php $checkedStatus = 'unchecked'; do { ?>
<?php ?>
<input type="radio" checked="<?php print $checkedStatus; ?>" name="candidate" value="<?php echo $row_getCandidateInfo['numberVotes']; ?>" id="<?php echo $row_getCandidateInfo['id'];?>" /><?php echo $row_getCandidateInfo['candidate'] . "<br />"; ?>
<?php } while ($row_getCandidateInfo = mysql_fetch_assoc($getCandidateInfo)); ?>
<br />
<input name="vote" type="submit" value="vote" />
<input type="hidden" name="MM_update" value="form1" />
</form>
Thank you!
Jon