A better approach would be to name all the fields "file" instead of "fileX" and then us the getParameterValues to get the enumeration of values taken from the fields named "file".... very simple and elegant.... not "for (int...." loop.... just a plain old while (enum.hasMoreElements()){ enum.nextElement().....}

if your javascrip relies on the field names, you can use the fields ID instead, because field ID isn't passed as parameter name....

[EMAIL PROTECTED] escribiÃ:

I have a form with multiple <input name="file0"> elements.
The names are generated and range file0..n

I'm trying (and failing) to retrieve the value of the input fields.
String f ="";
f = request.getParameter("file0");
works fine; The remainder appear inaccessible.
In the docs ...webapps/tomcat-docs/servletapi/index.html
I'm warned:
You should only use this method when you are sure the parameter has only
one value. If the parameter might have more than one value, use
getParameterValues(java.lang.String).


However, since each entry within the form has a variant name value,
what parameter should I pass to the getParameterValues method
to retrieve the multiple values?

tc 5.0.27 in use.


Regards DaveP.

**** snip here *****




-- John Villar Gerente de Proyectos Computadores Flor Hard Soft 2058 C.A. www.florhard.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to