Asp Getting Radio Checked Value

Asp Getting Radio Checked Value

I'm sure someone will help with this:

Basically I got a form which on submit, it directs it to my contact_form.asp which then sends out an email to a specified address, well I got some Radio buttons on that form, and need to get the checked radio button out of a group of about 3 radio buttons.

i.e.

<input type="radio" name="group1" id="serviceDaily" value="Daily">  Daily </input>
<input type="radio" name="group1" id="serviceWeekly" value="Weekly">  Weekly</input>
<input type="radio" name="group1" id="serviceMonthly" value="Monthly">  Monthly</input>

and in my contact_form.asp I am requesting the value like:

group1 = Request("group1")

Am I doing something wrong? i.e. getting the value incorrectly? The response I'm getting is "Group1", not "Daily" as I want to.

1 Answer

I created a test page using the code you supplied and it works fine (see below).

Try a http debugging tool such as fiddler2 to investigate the actual parameters and values passed between the two pages.

<html> 
<head></head> 
<body> 
<form method="post">
    <input type="radio" name="group1" id="serviceDaily" value="Daily">  Daily </input> 
    <input type="radio" name="group1" id="serviceWeekly" value="Weekly">  Weekly</input> 
    <input type="radio" name="group1" id="serviceMonthly" value="Monthly">  Monthly</input> 
    <input type="submit" value="submit" />
</form>
</div> 
<%
Dim group1
group1 = Request("group1") 
Response.Write ("group1='" + group1 + "'")
%>
</body> 
</html>
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.