Tuesday, March 29, 2011

Java script to get list box text

When you want to get list box selected text from your application using java script use the following js code.

var w = document.getElementById('picklistid').selectedIndex;
var selected_text = document.getElementById('picklistid').options[w].text;

selected_text variable will be returned the combo box selected text.

No comments:

Post a Comment