Radio button in JSP with same name return a single value to request object. Request.getParameter with radio field name will return a value of checked radio button.
Suppose we have three radio button and name of radioButton, if we select b value radio button, and submit this JSP page to getValue.jsp page. We will get value of request object is b.
demo
index.jsp
<html> <head> <title>Radio Button</title> </head> <body> <form name="frm" action="getValue.jsp" method="post" > <input name="radioButton" type="radio" value="a" checked="checked"/> a <input name="radioButton" type="radio" value="b" /> b <input name="radioButton" type="radio" value="c" /> c <input name="goto" type="submit" value="Submit" /> </form> </body> </html>
Fetching request value in this page of radio button
getValue.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java" %> <% String radioButton= request.getParameter("radioButton"); System.out.println("radioButton ::"+radioButton); out.println("Radio Button Value :"+radioButton); %>



Link to Us
simple and clear explanatory code
Thanks you.
useful for me too.
Thanks
thanks……
Quite good. Thanks …
i am doing the same but not getting any solution,
and getting null value