Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 Javascript Articles

In this article we shall be covering one approach to adding and removing items from a JavaSCRIPT array.

function addItemToList() {
destList = window.document.menuList.addList; srcList = window.document.menuList.stockList;
    var len = destList.length;
    for(var i = 0; i < srcList.length; i++) {
        if ((srcList.options[i] != null) && (srcList.options[i].selected)) { var found = false;
            for(var count = 0; count < len; count++) {
                if (destList.options[count] != null) {
                    if (srcList.options[i].text == destList.options[count].text) {
                        found = true; break;
                    }
                }
             }
             if (found != true) {
                destList.options[len] = new Option(srcList.options[i].text);
                 len++;
              }
          }
       }
    }


This article viewed: 2346 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Tuesday, May 13, 2008