M
Matt
I have radio buttons on a form, and when the user makes the selection, it
will trigger the event and send the form to the web server and print the
selected value. In Case 1, I just use submit button, without any event
handling, and it works fine.
However, in Case 2, which is what I am trying to do, it has the problem that
even when the user clicks the button, it won't show the value automatically.
But wait until user selects another choice.
Any ideas? Thanks!
----------------------------------------------------------------------------
-----
Case 1:
<%
If (Request.Form("submitbutton") = "submit here") Then
Response.Write(Request.Form("radiogroup"))
End If
%>
<html>
<body>
<form action="radiobuttontest.asp" name="myform" method="post">
<P>Choice 1<input type="radio" name="radiogroup" value="choice1">
<P>Choice 2<input type="radio" name="radiogroup" value="choice2">
<P>Choice 3<input type="radio" name="radiogroup" value="choice3">
<P><input type="submit" name="submitbutton" value = "submit here">
</form>
</body>
</html>
----------------------------------------------------------------------------
-----
Case 2:
<%
Response.Write(Request.Form("radiogroup"))
%>
<html>
<body>
<form action="radiobuttontest1.asp" name="myform" method="post">
<P>Choice 1<input type="radio" name="radiogroup" value="choice1"
onchange="document.myform.submit()">
<P>Choice 2<input type="radio" name="radiogroup" value="choice2"
onchange="document.myform.submit()">
<P>Choice 3<input type="radio" name="radiogroup" value="choice3"
onchange="document.myform.submit()">
</form>
</body>
</html>
will trigger the event and send the form to the web server and print the
selected value. In Case 1, I just use submit button, without any event
handling, and it works fine.
However, in Case 2, which is what I am trying to do, it has the problem that
even when the user clicks the button, it won't show the value automatically.
But wait until user selects another choice.
Any ideas? Thanks!
----------------------------------------------------------------------------
-----
Case 1:
<%
If (Request.Form("submitbutton") = "submit here") Then
Response.Write(Request.Form("radiogroup"))
End If
%>
<html>
<body>
<form action="radiobuttontest.asp" name="myform" method="post">
<P>Choice 1<input type="radio" name="radiogroup" value="choice1">
<P>Choice 2<input type="radio" name="radiogroup" value="choice2">
<P>Choice 3<input type="radio" name="radiogroup" value="choice3">
<P><input type="submit" name="submitbutton" value = "submit here">
</form>
</body>
</html>
----------------------------------------------------------------------------
-----
Case 2:
<%
Response.Write(Request.Form("radiogroup"))
%>
<html>
<body>
<form action="radiobuttontest1.asp" name="myform" method="post">
<P>Choice 1<input type="radio" name="radiogroup" value="choice1"
onchange="document.myform.submit()">
<P>Choice 2<input type="radio" name="radiogroup" value="choice2"
onchange="document.myform.submit()">
<P>Choice 3<input type="radio" name="radiogroup" value="choice3"
onchange="document.myform.submit()">
</form>
</body>
</html>