hi there,
im working on a dynamic select form combo function, which allows u to add values from one select list to another but i need some help to make the form process the values, they show up but arent being submitted! im a novice with javascript so a bit lost.
the script im using is like this:
picked=[]; // global array to remember selected items
function add2list(sourceID,targetID){
source=document.getElementById(sourceID);
target=document.getElementById(targetID);
numberOfItems=source.options.length;
insertPt=target.options.length; // insert at end
if (target.options[0].text==="") {insertPt=0;} // null option fix
for (i=0;i<numberOfItems;i++){
if(source.options.selected===true && picked!==true){
msg=source.options.text;
target.options[insertPt]=option;
picked=true;insertPt=target.options.length;
}
}
}
curr = 0;
function takefromlist(targetID)
{
target = document.getElementById(targetID);
// insert code to test to see if the box has options
// if it does not, return no value
for(var i = (target.options.length - 1); i >= 0; i--)
{
if(target.options.selected){target.options = null;curr--;}
}
}
im working on a dynamic select form combo function, which allows u to add values from one select list to another but i need some help to make the form process the values, they show up but arent being submitted! im a novice with javascript so a bit lost.
the script im using is like this:
picked=[]; // global array to remember selected items
function add2list(sourceID,targetID){
source=document.getElementById(sourceID);
target=document.getElementById(targetID);
numberOfItems=source.options.length;
insertPt=target.options.length; // insert at end
if (target.options[0].text==="") {insertPt=0;} // null option fix
for (i=0;i<numberOfItems;i++){
if(source.options.selected===true && picked!==true){
msg=source.options.text;
target.options[insertPt]=option;
picked=true;insertPt=target.options.length;
}
}
}
curr = 0;
function takefromlist(targetID)
{
target = document.getElementById(targetID);
// insert code to test to see if the box has options
// if it does not, return no value
for(var i = (target.options.length - 1); i >= 0; i--)
{
if(target.options.selected){target.options = null;curr--;}
}
}