Posted on 2010-11-22
I'm trying to construct a variable -> which consists of the element name..like this
str = ".hdnaccnum"+((frm.name).substr(3)); // returns hdnaccnum15
Now when i say --- alert(document.frmAvgData+str+".value"); It does'nt work
But when i say ---- alert(document.frmAvgData.hdnaccnum15.value) ; // it does work.
How can i construct dynamic variable which refers to an element and get its value