[Javascript] Variable in Object

Fraser Baker flbaker at sbcglobal.net
Fri Jan 6 07:00:50 CST 2006


Hi:

var icd9 = '123.12';

This works.

window.opener.document.invoice.diagnosis_0.value = icd9;

This doesn't:

var element = 'diagnosis_0';

window.opener.document.invoice.element.value = icd9;

I've tried a constructor and an eval and I can't get the variable into the
object.

How do I insert a variable name into the object?

Fraser




More information about the Javascript mailing list