Haddok
09-18-2002, 02:05 PM
:confused: I want to copy text from one listbox to another, [a] -> [b] by clicking a button.
Now, my problem is that I want to be able to remove copied options from [b] and at the same time remove the row (ie no blank rows as options).
The copy looks like this:
function copyOption()
{
document.f1.lstAddedMethod.options[document.f1.lstAddedMethod.length++].text = document.f1.lstMethodAlternative.options[document.f1.lstMethodAlternative.selectedIndex].text;
}
(This moves the selected option from [a] to [b],
The remove looks like this = My problem
function removeOption()
{
My idea : document.f1.lstMethodAlternative.options[document.f1.lstMethodAlternative.selectedIndex].text = "";
This does however not remove the row from [b]
}
Now, my problem is that I want to be able to remove copied options from [b] and at the same time remove the row (ie no blank rows as options).
The copy looks like this:
function copyOption()
{
document.f1.lstAddedMethod.options[document.f1.lstAddedMethod.length++].text = document.f1.lstMethodAlternative.options[document.f1.lstMethodAlternative.selectedIndex].text;
}
(This moves the selected option from [a] to [b],
The remove looks like this = My problem
function removeOption()
{
My idea : document.f1.lstMethodAlternative.options[document.f1.lstMethodAlternative.selectedIndex].text = "";
This does however not remove the row from [b]
}