I have HTML code which calls a javascript function from a form, using:
<form name="f" id="f" ...>
<input name="myField" onchange="doFunct(f.myField.value,f.yourField);" />
<input name="yourfield" onchange="doFunct(f.yourField.value,f.anotherField);" />
...
In the javascript code:
function doFunct(field,dest){
// do something with field
dest.value = field;
// see if the dest has a change field
if (dest.onchange !== null) {
//we have an onchange function, so let's do it!
dest.onchange();
}
}
This works fine in Safari, Opera, and Chrome. It fails in FireFox with an error:
Error: dest.onchange is not a function
Any suggestions on how to execute "dest.onchange()" from javascript in FireFox?
I need this capability to cascade changes to fields in an input form.