Hi,
Having trouble getting a javascript executed when an onchange event occurs at a text field on a page.
Here's the bit in the javascript where I'm trying to set this up...
// make the following fields update the prices on change...
alert(document.getElementById("value_somefield").onchange)
//document.getElementById("value_somefield").onchange='myscript("13")';
document.forms.editform.value_somefield.onchange = 'myscript("13")';
alert(document.getElementById("value_somefield").onchange)
The alerts are in there just to show what's happening...
On the first alert I get "undefined" - as expected since the onchange has not been set up.
On the second I get "myscript("13")" - which seems to indicate the event handler has been set.
But the event does not get triggered by a change in the value of "somefield".
I know the javascript function "myscript" is working as I can link it via Visual Editor to an onclick or onmouseover event on buttons on the same page. Works fine when activated that way.
Can anyone help with correct syntax? Or let me know if it is not possible to set the event handler in this way.
Thanx
Giles