wood burning stoves 2.0*
The moose likes JSP and the fly likes  How to Get Valueof SelectField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark " How to Get Valueof SelectField" Watch " How to Get Valueof SelectField" New topic
Author

How to Get Valueof SelectField

vivek wab
Greenhorn

Joined: Dec 04, 2006
Posts: 2
Hi All,
can please tell me how to get value of selectfield without submitting page in jsp?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Get it where? With what?

Please click on the "Asking Smart Questions" link below.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
vivek wab
Greenhorn

Joined: Dec 04, 2006
Posts: 2
i want value of SelectField without submitting the page by using jsp.
BuccaneerAnirban Bhattacharjee
Greenhorn

Joined: Nov 23, 2006
Posts: 9
document.forms[1].selectedCustomerCode.options[document.forms[1].selectedCustomerCode.selectedIndex].value

Where selectedCustomerCode is the name used in <select> tag

Regards-
Anirban [SCJP, SCWCD]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"In JSP", you can't get it without submitting the page.

Your JSP code resides up on the server.
You can work with the selected value on the client with Javascript using the the technique mentioned by vivek.

What are you trying to do with the value of the select list?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Get Valueof SelectField