<form action="loginServlet" method="post">
<input type="hidden" name="action">
<p><input type="radio" name="grain" value="product/1858C">Avangard Malz Premium Caramel 55 Lb 8L (like C10)</p>
<p><input type="radio" name="grain" value="product/1860C">Avangard Malz Premium Caramel 55 Lb 30L (like C30)</p>
<br />
<input type="submit" value="Submit" class = "button">
</form>
如何引用在JSP中选中的单选按钮? 类似于: String action = request.getParameter(“action”); 但该参数必须是选中的单选按钮。单击提交按钮时引用单选按钮的值jsp
你不想要request.getParameter(“谷物”)? – ControlAltDel
哦,我明白了。所以这将返回选中的单选按钮值作为一个字符串? – Peter
@Peter,你期待什么回报? – PacMan