jQuery in Action, 3rd edition
The moose likes JSP and the fly likes JSP beginner - adding listbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP beginner - adding listbox" Watch "JSP beginner - adding listbox" New topic

JSP beginner - adding listbox

Noreen Masterson

Joined: Apr 30, 2002
Posts: 16
I am just starting to use JSPs
and have been trying to add a listbox to one
how do i go about this - it should just be a single selection listbox....

All help appreciated
thanx muchly
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Start by making a plain HTML page with a listbox, any good HTML text will tell you how.
After you get what you want with plain HTML then you can try to duplicate it with JSP.
Noreen Masterson

Joined: Apr 30, 2002
Posts: 16
Hi have my listbox using SELECT
and added in my list using OPTION
i have a button on the jsp too
and would like to have a onclick method
that will pick up the selected item in teh listbox
i know how to do the onckcik function in javascript
but how do i access the list from it?
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
will give the value of the selected item from the listbox.
Replace formName with the name of your form and selectName with the name of the listbox.
[ November 29, 2002: Message edited by: R Manivannan ]

Quaerendo Invenietis
Nilesh Dudhekar

Joined: May 25, 2002
Posts: 1
hi noreen,
make the plain html with all the controls required ...i ur case a listbox and a button.
u can write a js function which will display the selected value of the listbox....this will be onclick of a button follwing function will give u requird value
for(var i=0;i<window.document.form.selectList.length;i++)
// this will be the value in list box which u will required.

hope this will help u...
I agree. Here's the link: http://aspose.com/file-tools
subject: JSP beginner - adding listbox
It's not a secret anymore!