• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

form inputs in servlets

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how do i get html form inputs radiobutton group in servlets
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

if user selects multiple checkboxes, then how to pass those multiple values to servlet ?



 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic