I have a web form with two radio buttons from which the user makes a selection and gets a different set of choices. These work fine except that the selected radio button won't maintain its checked state after the submit button is clicked (too bad there isn't an onclick event so that I could get rid of the button). Here is the basic code I have now:
<tr>
<td colspan='2' align='center'>
<input type='radio' name='radSelectBy' value='State' ><b>Select State</b>
<br>
<input type='radio' name='radSelectBy' value='Region' ><b>Select by Region</b>
</td>
</tr>
<tr>
<td colspan='2' align='center'>
<input type='submit' value='Submit'></input>
</td>
</tr>
<%
Session("Sel") = Request.Form("radSelectBy")%>
<tr>
<td align='center'>
<%= Session("Sel") %>
</td>
<td align='center'>
<%
If (Session("Sel") = "Region") Then
%>
Select by Region
<%
End If
If (Session("Sel") = "State") Then
%>
Select by State
<%
End If
%>
</td>
</tr>
I have tried using the session variable to create an If statement that selects a checked version of one radio button and an unchecked version of the other, and it worked but only if the screen is refreshed (the processing in the last If statement works fine) and that pops up a message box saying that the information must be retransmitted and did I really want to do it)
How can I make the checkboxes maintain state?
<tr>
<td colspan='2' align='center'>
<input type='radio' name='radSelectBy' value='State' ><b>Select State</b>
<br>
<input type='radio' name='radSelectBy' value='Region' ><b>Select by Region</b>
</td>
</tr>
<tr>
<td colspan='2' align='center'>
<input type='submit' value='Submit'></input>
</td>
</tr>
<%
Session("Sel") = Request.Form("radSelectBy")%>
<tr>
<td align='center'>
<%= Session("Sel") %>
</td>
<td align='center'>
<%
If (Session("Sel") = "Region") Then
%>
Select by Region
<%
End If
If (Session("Sel") = "State") Then
%>
Select by State
<%
End If
%>
</td>
</tr>
I have tried using the session variable to create an If statement that selects a checked version of one radio button and an unchecked version of the other, and it worked but only if the screen is refreshed (the processing in the last If statement works fine) and that pops up a message box saying that the information must be retransmitted and did I really want to do it)
How can I make the checkboxes maintain state?