Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

JSP / EL question: how to pick out a request param for list/combo box, and radio button group

Thread view: 
mot12345@alexandria.ucsb.edu - 21 Feb 2006 01:28 GMT
Please excuse and guide me elsewhere if this is not the right group for
this post.

I cant figure out what the proper JSP / EL syntax is to pick out the
value of a list/combo box and of a radio button group in an HTML form.

I know that for a simple input field, like
<input name="fieldName" type="text" value="70" size="10" maxlength="5">
it's just
${param.fieldName}

But what does it look like for a combo box, say:
<SELECT name="fontSize">
    <OPTION value="val1">12pt</option>
    <OPTION value="val2">14pt</option>
</SELECT>

and for a group of radio buttons, say:
<input type="radio" name="headers" value="Brief"> Brief
<input type="radio" name="headers" value="Full" checked>Full<br>
     
Thanks for your help,
Wolfgang,
Santa Barbara, CA
John C. Bollinger - 24 Feb 2006 03:11 GMT
> Please excuse and guide me elsewhere if this is not the right group for
> this post.
[quoted text clipped - 12 lines]
>     <OPTION value="val2">14pt</option>
> </SELECT>

As long as the <select> does not allow multiple selections, its just the
same as any other control: ${param.name}, which will give you either
"val1" or "val2" (or possibly nothing if the browser is not
standard-compliant and the user doesn't choose any option).

> and for a group of radio buttons, say:
> <input type="radio" name="headers" value="Brief"> Brief
> <input type="radio" name="headers" value="Full" checked>Full<br>

Again, the same thing: ${param.headers}, which will give you either
"Brief" or "Full".  (Since you start out with one option selected, a
browser should not allow the button group to enter a state where no
option is selected, hence you should always get a value.  Of course,
"should" != "will".)

This is really about the details of form submission, which are laid out
fairly explicitly in the HTML specs.  See
http://www.w3.org/TR/html4/interact/forms.html#h-17.13, for instance.

Signature

John Bollinger
jobollin@indiana.edu



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.