BrightNail
07-24-2002, 10:57 PM
hey all,
why am I having a brain fart on this...its easy..what obvious thing am I missing?
I am passing the "form name & element name" via function call..
inputValues('carform.textdata','17.00')
to a function...but when I try to "use" the passed variable, I get errors "blah blah..has no properties.
function inputValues(boxName, boxValue){
document[boxName].value=boxValue;
}
I've tried everything..
document(boxName).value=boxValue
document.boxName.value
document.[boxName].value
with periods, without..with brackets, without...
etc..
etc..
when I throw an alert..the CORRECT value is in the variable name..when I hard code it..
document.carform.textdata.value
it works just fine...
what is the deal?..is it interpreting the value as a non-string... dont' know..help..
thanks,
james
why am I having a brain fart on this...its easy..what obvious thing am I missing?
I am passing the "form name & element name" via function call..
inputValues('carform.textdata','17.00')
to a function...but when I try to "use" the passed variable, I get errors "blah blah..has no properties.
function inputValues(boxName, boxValue){
document[boxName].value=boxValue;
}
I've tried everything..
document(boxName).value=boxValue
document.boxName.value
document.[boxName].value
with periods, without..with brackets, without...
etc..
etc..
when I throw an alert..the CORRECT value is in the variable name..when I hard code it..
document.carform.textdata.value
it works just fine...
what is the deal?..is it interpreting the value as a non-string... dont' know..help..
thanks,
james