I have a piece of code written for IE that uses onpropertychange. 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 :
Expand|Select|Wrap|Line Numbers
- <public:attach event="onpropertychange" onevent="handlePropertyChange()"/>
- <script language="JScript">
- function handlePropertyChange() {
- if (event.propertyName == 'value') {
- syncronize hidden element with UI
- }
- }
- </script>
and something similar for the UI element. The above code fires when I do :
Expand|Select|Wrap|Line Numbers
- function someFunction(el) {
- el.value = 5;
- }
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