Listbox

14 views
Skip to first unread message

Alireza Rahmatizadeh

unread,
Mar 13, 2015, 10:41:34 AM3/13/15
to fac...@googlegroups.com
Hi,

I'm using facebox to show a listbox and a button. when the button is pressed, it should return the selected Item in the listbox using javascript on the client side.

Everything works fine when I'm not using facebox, but with facebox, selected property always returns false, here is the javascript code I'm using :

var sel = document.getElementById('<%=myListBox.ClientID%>');

var listLength = sel.options.length;
for (var i = 0; i < listLength; i++) {
                if (sel.options[i].selected) {
                    alert(sel.options[i].text);
               }
Reply all
Reply to author
Forward
0 new messages