This is a migrated thread and some comments may be shown as answers.

default to checked

1 Answer 24 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 2
Bill asked on 16 Dec 2009, 07:37 PM
I have a situation where the cusomer want all items in a set of listbox with checkboxes to be selected/checked when the form loads.
How would I go about this?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 17 Dec 2009, 05:45 AM
Hi Bill,

Try adding following client side code in order to check all the listbox items.

javascript:
 
<script type="text/javascript"
    function OnClientLoad(sender, args) { 
        for (var i = 0; i < sender.get_items().get_count(); i++) { 
            sender.getItem(i).set_checked(true); 
        } 
    } 
</script> 

-Shinu.
Tags
ListBox
Asked by
Bill
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 1
Share this question
or