Collecting a radio-button value in Classic ASP

Radio buttons are appropriate when the visitor should choose exactly one value from a group. Give every radio button in the group the same name and a different value.

<form method="post" action="radio-check.asp">
  <label><input type="radio" name="choice" value="yes"> Yes</label>
  <label><input type="radio" name="choice" value="no"> No</label>
  <button type="submit">Submit</button>
</form>

The receiving ASP page can read the selected value directly:

Dim choice
choice = Request.Form("choice")
Response.Write Server.HTMLEncode(choice)

If no radio button is selected, the submitted value can be empty. Validate the result against the values your application allows instead of trusting arbitrary request text.


ASP Home






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer