seanybravo
IS-IT--Management
I want to check what form element (listboxes) is being passed to this function and I have a list of numbers that have to be dealt with differently in a sort, but I am having trouble with the If statement because I seam to be passing an object. I think that it is because I am using the this shortcut.
Any help would be appreciated
Thanks
This is the call to it.
Any help would be appreciated
Thanks
Code:
function moveOptions(theSelFrom, theSelTo)
{
var selLength = theSelFrom.length;
var selectedText = new Array();
var selectedValues = new Array();
var selectedCount = 0;
var i;
// Find the selected Options in reverse order
// and delete them from the 'from' Select.
for(i=selLength-1; i>=0; i--)
{
if(theSelFrom.options[i].selected)
{
selectedText[selectedCount] = theSelFrom.options[i].text;
selectedValues[selectedCount] = theSelFrom.options[i].value;
deleteOption(theSelFrom, i);
selectedCount++;
}
}
// Add the selected text/values in reverse order.
// This will add the Options to the 'to' Select
// in the same order as they were in the 'from' Select.
for(i=selectedCount-1; i>=0; i--)
{
addOption(theSelTo, selectedText[i], selectedValues[i]);
}
if(NS4) history.go(0);
//Problem Here !!!!!!
//This is where I am trying to check what listbox is being passed
if (theSelTo == document.form['CustomerDetails'].elements['SelectedEmployees'] || theSelTo == 'Employees'){
alert("employees")
sortOptionsN(theSelTo)
}
}
This is the call to it.
Code:
onclick="moveOptions(this.form.SelectedEmployees,this.form.Employees)"