Hi,
This may be one of those painfully obvious questions that I'm just not seeing. However, I'm NOT seeing it so here's the question:
I'm using session variables in my forms by adding a value attribute that holds the session variable that was set by the POST value. For example, a first name field looks like this:
First Name <input type="text" name="firstName" id="firstName" value="' . $_SESSION["firstName"] . '" size="20">
The first name session variable was set like this:
$_SESSION['firstName'] = $_POST['firstName'];
How do I do the same thing for radio buttons and checkboxes that all have the same name and that already have a set value? For example, how would I format the HTML field so it can hold $_SESSION['conferenceAttending']?
Here's how I set the session variable:
$_SESSION['conferenceAttending'] = $_POST['conferenceAttending']['value'];
And here's the corresponding place in the HTML:
<input type="radio" value="1" name="conferenceAttending">Attending Pre-Conference Only<br><input type="radio" value="2" name="conferenceAttending"> Attending General Conference Only<br><input type="radio" value="3" name="conferenceAttending"> Attending Both<br>
How can I add the information from the conferenceAttending session variable so when a user brings up the form again, the radio button they checked will still be checked, will be resubmitted after they make whatever edits they make to the page, etc. I'm thinking maybe I have to insert a CHECKED attribute in the HTML based on the value of conferenceAttending, but I'm not real sure how to do that.