0

Hi,

I'm trying to loop through a listbox that is runat="server" (to get all the values of the items inside the listbox regarless of if they are selected or not).

Now i have searched for hours on end and still don't find anything (all the examples is just for the selected items....). Can someone please guide me to the correct way of doing this. O, i want to do it with jQuery preferably.

-------------------
phoenix_dwarf

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by phoenix_dwarf
0

loop through a listbox

var oLB = getElementById("boxname")
            for (var i = 0; i < oLB.options.length; i++) {
                 ... process oLB.options[i].value ...
            }
0
var oLB = getElementById("boxname")
            for (var i = 0; i < oLB.options.length; i++) {
                 ... process oLB.options[i].value ...
            }

Thnx but already tried that and then i get this error: "Microsoft JScript runtime error: 'options.length' is null or not an object"...

Any thoughts??

Edited by phoenix_dwarf: n/a

0

My apologies. It is working now, the only problem was that i tried using jQuery instead of getElementByID...

Thanx again

--------
aQuila

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.