Hey everyone. I have an ASP page that contains a form with a series of dynamically named text boxes. What I want to do is when the user changes the value in a text box, onBlur, call the below javascript function that passes a record ID and uses it to calculate the value of another text box.
Here is the function:
function doCFIS(ID){
document.frmEdit.txtMFN+(ID).value = (document.frmEdit.txtGeoLoc+(ID).value + document.frmEdit.txtSubNum+(ID).value + document.frmEdit.txtSeqNum+(ID).value);
}
I am thinking the problem is the way I refer to the form text boxes. The function says txtMFN+(ID). So if the ID that was passed was 123 then the text box I want to populate would be txtMFN123. I am more of a vbScript guy than a Javascript guy. To me this should work. Can I NOT dynamically assemble a statement like I have above?
Thanks in advance for any help.
Shane
Here is the function:
function doCFIS(ID){
document.frmEdit.txtMFN+(ID).value = (document.frmEdit.txtGeoLoc+(ID).value + document.frmEdit.txtSubNum+(ID).value + document.frmEdit.txtSeqNum+(ID).value);
}
I am thinking the problem is the way I refer to the form text boxes. The function says txtMFN+(ID). So if the ID that was passed was 123 then the text box I want to populate would be txtMFN123. I am more of a vbScript guy than a Javascript guy. To me this should work. Can I NOT dynamically assemble a statement like I have above?
Thanks in advance for any help.
Shane
Comment