Hello,
I have a piece of code written for IE that uses onpropertychang e. I want to make the code work on Firefox also, but i couldnt find an equivalent event that fires when the value is changed in JS scripts and i need help.
My problem is this. I have 2 html elements: an input type hidden that keeps the value which will be posted and an UI value (type=text) that shows the value to the user. What I need to do is to syncronize the modifications for these two values: when the hidden element is changed, the UI value is changed and vice-versa.
My script for IE :
[CODE=javascript]<public:attac h event="onproper tychange" onevent="handle PropertyChange( )"/>
<script language="JScri pt">
function handlePropertyC hange() {
if (event.property Name == 'value') {
syncronize hidden element with UI
}
}
</script>[/CODE]
and something similar for the UI element. The above code fires when I do :
[CODE=javascript]function someFunction(el ) {
el.value = 5;
}[/CODE]
and makes the UI value also 5 (and vice-versa).
Really, my question is how can i know when the value of the hidden element was changed somewhere in some JS script (and works on FF also) ?
Thank you,
Bogdan
I have a piece of code written for IE that uses onpropertychang e. I want to make the code work on Firefox also, but i couldnt find an equivalent event that fires when the value is changed in JS scripts and i need help.
My problem is this. I have 2 html elements: an input type hidden that keeps the value which will be posted and an UI value (type=text) that shows the value to the user. What I need to do is to syncronize the modifications for these two values: when the hidden element is changed, the UI value is changed and vice-versa.
My script for IE :
[CODE=javascript]<public:attac h event="onproper tychange" onevent="handle PropertyChange( )"/>
<script language="JScri pt">
function handlePropertyC hange() {
if (event.property Name == 'value') {
syncronize hidden element with UI
}
}
</script>[/CODE]
and something similar for the UI element. The above code fires when I do :
[CODE=javascript]function someFunction(el ) {
el.value = 5;
}[/CODE]
and makes the UI value also 5 (and vice-versa).
Really, my question is how can i know when the value of the hidden element was changed somewhere in some JS script (and works on FF also) ?
Thank you,
Bogdan
Comment