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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -