Event that fires when the value changes
-
Does anyone know of an event that fires when a value is set on an element from within JavaScript? Example: $get('id1').value = $get('id2').value (copy values between input controls). Is there an event that will fire on control 'id1' when it is modified this way? Thanks,
Leo T. Smith Program/Analyst Supervisor
-
Does anyone know of an event that fires when a value is set on an element from within JavaScript? Example: $get('id1').value = $get('id2').value (copy values between input controls). Is there an event that will fire on control 'id1' when it is modified this way? Thanks,
Leo T. Smith Program/Analyst Supervisor
I am not a javascript expert but I think the answer is no. You could instead have a function that updates id1, e.g. setID1(value) and then it could do the work of the event handler you want.
'Howard
-
I am not a javascript expert but I think the answer is no. You could instead have a function that updates id1, e.g. setID1(value) and then it could do the work of the event handler you want.
'Howard
-
Thanks for your answer. It was what I expected, but I want to know how in a world of security, there is not a way to see when your values have changed by someone other than the user. Thanks,
Leo T. Smith Program/Analyst Supervisor
Javascript runs on the browser. You can assume absolutely nothing about the browser or its security. It would be easy enough with modern debugging tools like FireBug etc to stop a javascript function, change some values and continue. Keep all sensitive information on the server.
'Howard
-
Javascript runs on the browser. You can assume absolutely nothing about the browser or its security. It would be easy enough with modern debugging tools like FireBug etc to stop a javascript function, change some values and continue. Keep all sensitive information on the server.
'Howard
Actually I ready keep the sensitive information on server only, but there comes a time when knowing when an element has changed a value could be useful. I find the reasons more compelling as I use AJAX and client side scripting. An example would be for an extender control that needs to do some action when the control that it has extended (i.e. text input) has had its value changed is used to set other internal things within the control. If there was a trigger that fired when this happened, you would not force a programmer to use your behavior to set things up when the value changed. I know that under the current paradign this is not a common occurance, but in the future it could become a greater problem in making more user friendly applications. Just my thoughts. Thanks for your time,
Leo T. Smith Program/Analyst Supervisor