*
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
Author

getting form data

eric clark
Greenhorn

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();
out.print("|"+paraname+"|");
out.println(request.getParameterValues(paraname));
}
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
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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 );
Bill
eric clark
Greenhorn

Joined: Jan 18, 2001
Posts: 16
thanx, it works now
greets eric
 
 
subject: getting form data