Hello,
I think what I am trying to do amounts to pass by reference. Perhaps
there is other way to do this...
I need to manipulate indices of selected items in select list. So,
normally one would write something like
document.myform .myselobj.optio ns[document.myform .myselobj.optio ns.selectedInde x].value
= 2;
Instead, I'd like to write a little set/get functions to save some typing:
setFunction(doc ument.myform.my selobj, 2) -> set value of selectedIndex to 2
getFunction(doc ument.myform.my selobj) -> would return current index.
I can do the getFunction:
function getSelectListVa lue(object)
{
return object.options[object.selected Index].value;
}
My question is how to implement the setFunction()
Sorry if this has been asked before - I googled but did not come up with
anything useful.
thanks,
denis
I think what I am trying to do amounts to pass by reference. Perhaps
there is other way to do this...
I need to manipulate indices of selected items in select list. So,
normally one would write something like
document.myform .myselobj.optio ns[document.myform .myselobj.optio ns.selectedInde x].value
= 2;
Instead, I'd like to write a little set/get functions to save some typing:
setFunction(doc ument.myform.my selobj, 2) -> set value of selectedIndex to 2
getFunction(doc ument.myform.my selobj) -> would return current index.
I can do the getFunction:
function getSelectListVa lue(object)
{
return object.options[object.selected Index].value;
}
My question is how to implement the setFunction()
Sorry if this has been asked before - I googled but did not come up with
anything useful.
thanks,
denis
Comment