But the question is still, why does it matter what the order of the form
elements is? It doesn't matter where an element appears in the form,
getParameterValues will always work. You can call getParameterValues in
any order.
For example, given a form:
<form>
<input name=bla1 .../>
<input name=bla2 .../>
<input name=bla3 .../>
</form>
Your servlet code can be
String[] s1 = getParameterValues("bla1");
String[] s2 = getParameterValues("bla2");
String[] s3 = getParameterValues("bla3");
or it could be
String[] s1 = getParameterValues("bla3");
String[] s2 = getParameterValues("bla1");
String[] s3 = getParameterValues("bla2");
or it could be
String[] s1 = getParameterValues("bla2");
String[] s2 = getParameterValues("bla3");
String[] s3 = getParameterValues("bla1");
It just doesn't matter.
And if you have forms where the same name is used multiple times, you
should be using getParameterValues() and not getParameter(). Knowing the
order won't help you because getParameter() will always return the same
item. getParameter() where the name was used multiple times in the form
is the same as calling getParameterValues() and retrieving the first
element in the String array (in other words, getParameter =
getParameterValues()[0]).
Besides, can't you just look at the form to see what order they are in?
K Mukhar
Tiago Antão wrote:
>
> On Tue, 17 Oct 2000, SEYNAVE, PATRICK wrote:
>
> > I'm not sure I understand your problem... I read post data by calling
> > request.getParameter("param_name") for each one of my parameters.
> > It's that easy!
>
> the problem is this, if I have a form
> <input name=bla1 .../>
> <input name=bla2 .../>
> <input name=bla3 .../>
>
> I'd like to know that the order specified in html was
> first - bla1,
> 2 - bla2,
> 3 - bla3
>
> More, if I have input names that are equal I'd need to know the order (And
> yes, I have users who request to repeat form paramater names in their
> forms, go figure...)
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html