default to checked

2 posts, 0 answers
  1. Bill
    Bill avatar
    85 posts
    Member since:
    Oct 2007

    Posted 16 Dec 2009 Link to this post

    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?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Dec 2009 Link to this post

    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.
Back to Top