N
Nonprofit Programmer
I have the below code. I am trying to add the function chgDI() as the
handler for onChange event. However, the reference chgDI(newelement.value),
if
in parentheses, is not recognized as a function call. If parentheses are left
out, it is called only when the drawBOX function is called, and not when the
text area changes. Using addEvent results in a 'mismatch' error. Using
setAttribute doesn't work either. What can I do?
CODE within drawBOX() function:
newelement.attachEvent("change", chgDI(newelement.value));
-OR-
newelement.setAttribute("onChange" , "chgDI(newelement.value)");
I've tried both statements with and witout parentheses. No joy.
handler for onChange event. However, the reference chgDI(newelement.value),
if
in parentheses, is not recognized as a function call. If parentheses are left
out, it is called only when the drawBOX function is called, and not when the
text area changes. Using addEvent results in a 'mismatch' error. Using
setAttribute doesn't work either. What can I do?
CODE within drawBOX() function:
newelement.attachEvent("change", chgDI(newelement.value));
-OR-
newelement.setAttribute("onChange" , "chgDI(newelement.value)");
I've tried both statements with and witout parentheses. No joy.