Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

form inputs in servlets

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i get html form inputs radiobutton group in servlets
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean how do you get the selected value? If so, then you simply call getParameter() for the name of the radiogroup. For instance,
<HTML><FORM METHOD=POST ACTION="Some url">
<INPUT TYPE=CHECKBOX NAME=radios VALUE="box1">
<INPUT TYPE=CHECKBOX NAME=radios VALUE="box2">
<INPUT TYPE=CHECKBOX NAME=radios VALUE="box3">
</FORM>
</HTML>
Now, you simple call getParameter("radios") in the servlet and the value that will be returned will be the value associated with the radio that the user selected. I hope this helps.
Sean
 
arpit singla
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if user selects multiple checkboxes, then how to pass those multiple values to servlet ?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if user selects multiple checkboxes, then how to pass those multiple values to servlet ?


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic