Welcome Guest Search | Active Topics | Sign In | Register

ListBox SelectedIndex and SelectedItem.Value properties not being set Options
Joan Darling
Posted: Wednesday, January 4, 2012 1:20:18 PM
Rank: Advanced Member
Groups: Member

Joined: 3/9/2010
Posts: 119
I have a combobox that uses a listbox. The listbox's header and item templates a designed to show 2 columns and the datasource is a datatable. The controls operate properly but when I try to read the listbox’s selectedindex or seleteditem.value from javascript or on postback the values are -1 and null respectively. How can I get at these values?
eo_support
Posted: Wednesday, January 4, 2012 4:00:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to use our client side JavaScript interface to access the ListBox control:

http://www.essentialobjects.com/doc/1/jsdoc.public.listbox.aspx

If you are not familiar with the client side JavaScript interface, you will need to take a look of this:

http://www.essentialobjects.com/doc/1/clientapi_howto.aspx

Thanks!
Joan Darling
Posted: Wednesday, January 4, 2012 4:35:11 PM
Rank: Advanced Member
Groups: Member

Joined: 3/9/2010
Posts: 119
When I use the following I the the error "Microsoft JScript runtime error: Object doesn't support this property or method"

Code: HTML/ASPX
var item = document.getElementById("<%=ListBox1.ClientID %>").getSelectedItem();


I also tried the following with the same result
Code: HTML/ASPX
var list = document.getElementById("<%=ListBox1.ClientID %>");
var item = list.getSelectedItem();



You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.