html - Value of radio button is as NULL and ON -
i'm trying retrieve value of radio button in servlet im getting on ones have selected , null ones have not selected. i'm not getting values. please me out.
the servlet
for(int i=0;i<itemnode.getlength();i++){ ans[i] = request.getparameter(integer.tostring(i)); system.out.println(ans[i]); }
the html page :
<input type="radio" name="1" value="1" style="float: left;"> <input type="radio" name="1" value="2" style="float: left;"> <input type="radio" name="1" value="3" style="float: left;"> <input type="radio" name="1" value="4" style="float: left;"> <input type="radio" name="2" value="1" style="float: left;"> <input type="radio" name="2" value="2" style="float: left;"> <input type="radio" name="2" value="3" style="float: left;"> <input type="radio" name="2" value="4" style="float: left;">
the output @ console:
null on
null ones have not selected , on ones have selected
Comments
Post a Comment