>>> Fricka Kaichy Ling <[EMAIL PROTECTED]> 15-Jun-00 4:17:24 PM >>>
>I can't quite figure out how to process those html forms
>where you can select one or more options using servlets.
You could mean one of 3 things, either a <SELECT> box which is a drop
down list, or radio buttons or checkboxes.
>I think the call getParameter() only returns the first(?)
>selection, rather then all the selections.
It depends what form element you mean.
<SELECT> actually returns only the selection that is "selected".
with:
<SELECT name="freds-status">
<OPTION VALUE="sacked">
<OPTION VALUE="about to be sacked">
<OPTION VALUE="earning">
<OPTION VALUE="raking it in" SELECTED>
<OPTION VALUE="java servlet programmer">
</SELECT>
the servlet bit:
String status=request,getParameter("freds-status");
will make status=="raking it in"
Whereas <input type="checkbox"> can be used to get many different
values, like this:
<form ...>
<input type="checkbox" name="freds-abilities" value="java
servlets">Java Servlets
<input type="checkbox" name="freds-abilities" value="network
management">Nets
<input type="checkbox" name="freds-abilities" value="microtoss
tools">M$
</form>
If the user selects "java servlets" and "network management" then the
code:
String[] abilities=request.getParameterValues("freds-abilities");
will get the following array:
{ "java servlets" "network management" }
Radio buttons are similar to SELECT boxes.
Stuff like this is a bit off-topic because you can always find it out
from a good HTML book.
Nic
___________________________________________________________________________
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