Loading ...
Sorry, an error occurred while loading the content.

DragDrop Move All Items From One List To Another

Expand Messages
  • Justin
    I need to make a button, when clicked, that moves all items from one list (list1) to the other list (list2). I have no idea to go about doing it. [code]
    Message 1 of 1 , Jul 3, 2007
    • 0 Attachment
      I need to make a button, when clicked, that moves all items from one
      list (list1) to the other list (list2). I have no idea to go about
      doing it.

      [code]
      document.getElementsByClassName = function(cl) {
      var retnode = [];
      var myclass = new RegExp('\\b'+cl+'\\b');
      var elem = this.getElementsByTagName('*');
      for (var i = 0; i < elem.length; i++) {
      var classes = elem[i].className;
      if (myclass.test(classes)) retnode.push(elem[i]);
      }
      return retnode;
      };

      function moveAll()
      {
      var items, i;

      items = document.getElementsByClassName("list1");
      for(i=0; i<items.length; i++)
      {
      //Do code to move all items from list1 to list2.

      }
      }
      [/code]
    Your message has been successfully submitted and would be delivered to recipients shortly.