File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes getting form data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "getting form data" Watch "getting form data" New topic

getting form data

eric clark

Joined: Jan 18, 2001
Posts: 16
mornin all, im just trying to find some way to collect all data from a field of radiobuttons on a jsp site, to write it back in a database..what i got btw is this:
String paraname = "";
for (Enumeration selectedValues = request.getParameterNames();selectedValues.hasMoreElements(); ) {
paraname = selectedValues.nextElement().toString();
problem is that it doesnt werk prolly some1 sees a solution?
[This message has been edited by eric clark (edited January 18, 2001).]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
For radio buttons, the "name" is the name of the group - there will be only one parameter for any radio button group so don't use request.getParameterValues(paraname)
use getParameter( paraname );
eric clark

Joined: Jan 18, 2001
Posts: 16
thanx, it works now
greets eric
I agree. Here's the link:
subject: getting form data
It's not a secret anymore!