Home
> Uncategorized > Javascript for copying a drop down list
Javascript for copying a drop down list
I found this nifty piece of javascript handy for copying the contents of one drop down list into another
function copyDropDownList(source,destination)
{
for(i=0;i<source.options.length;i++)
{
optionText = source.options[i].text;
optionValue = source.options[i].value;
destination.add(new Option(optionText,optionValue));
}
}
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback