Move Listbox items to another Listbox using jquery

<script type="text/javascript" src="Js/jquery-1.9.1.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#<%=btnAdd.ClientID %>').click(function () {
                var selectedOptions = $('#<%=lstSource.ClientID %> option:selected');
                  if (selectedOptions.length == 0) {
                      alert("Please select option to move");
                      return false;
                  }
                  $('#<%=lstTO.ClientID %>').append($(selectedOptions).clone());
                $(selectedOptions).remove();
                return false;
              });
            $('#<%=btnRemove.ClientID %>').click(function () {
                var selectedOptions = $('#<%=lstTO.ClientID %> option:selected');
                if (selectedOptions.length == 0) {
                    alert("Please select option to move");
                    return false;
                }
                $('#<%=lstSource.ClientID %>').append($(selectedOptions).clone());
                $(selectedOptions).remove();
                return false;
            });
        });


    </script>


Hope this will helps you...........

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell