• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Get Valueof SelectField

 
vivek wab
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
can please tell me how to get value of selectfield without submitting page in jsp?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get it where? With what?

Please click on the "Asking Smart Questions" link below.
 
vivek wab
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want value of SelectField without submitting the page by using jsp.
 
BuccaneerAnirban Bhattacharjee
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic