jshowe
07-07-2003, 10:28 PM
Hi,
I am very new and am trying to make a function that will update the value for multiple different elements. I need Product08 to be Product02, Product04, Product15, but not Product03 or Product05,etc... So I can't just use a for loop. Is there a way I can just make it a variable and have whatever calls to the function replace Product08 with it's name?
ie- if <select onchange=reCalc() name=Product02> Can I make Product02 take the place of Product08 on the fly???
BTW - Product08Total and the Other Product0XTotals are input boxes...
Thanks!!
function reCalc()
{
current=document.TheForm.Product08.selectedIndex;
thisValue =
document.TheForm.Product08.options[current].value;
document.TheForm.Product08Total.value = thisValue;
}
I am very new and am trying to make a function that will update the value for multiple different elements. I need Product08 to be Product02, Product04, Product15, but not Product03 or Product05,etc... So I can't just use a for loop. Is there a way I can just make it a variable and have whatever calls to the function replace Product08 with it's name?
ie- if <select onchange=reCalc() name=Product02> Can I make Product02 take the place of Product08 on the fly???
BTW - Product08Total and the Other Product0XTotals are input boxes...
Thanks!!
function reCalc()
{
current=document.TheForm.Product08.selectedIndex;
thisValue =
document.TheForm.Product08.options[current].value;
document.TheForm.Product08Total.value = thisValue;
}