Håkon Nordli
Nov 25, 2015
  6265
(0 votes)

Extend Dojo's onChange event by using intermediateChanges

One of JavaScripts built-in events are 'change'. It is triggered different depending on which input type you are using. For text input it is fired when the element looses focus after its value has changed. 

Not suprisingly, onChange in Dojo works the same. However it is possible to make it fire whenever the value changes by using intermediateChanges. 

The built-in dijit property, intermediateChanges, is a part of dijit.form widgets. By default it is set to false, but when it is set to true, it fires the onChange event whenever the value of the form widget changes.  This way it is possible to trigger something while the user is editing a property and before a text input looses focus.  

 

image

Nov 25, 2015

Comments

Please login to comment.
Latest blogs
Avoid Scandinavian Letters in File Names in Optimizely CMS

Discover how Scandinavian letters in file names can break media in Optimizely CMS—and learn a simple code fix to automatically sanitize uploads for...

Henning Sjørbotten | Jun 19, 2025 |

Exporting Optimizely databases causing errors

Solutions to a couple of recurring issues when migrating databases to the cloud.

Tomas Hensrud Gulla | Jun 18, 2025 |

Common Pitfalls with Search in Optimizely Graph - and How to Avoid Them

Optimizely Graph offers powerful, flexible search capabilities out of the box, making it a popular choice for headless implementations. However, li...

Michał Mitas | Jun 18, 2025

Introducing the Feature Experimentation Administrator Certification

We’re excited to announce the launch of the  Feature Experimentation Administrator Certification,  the newest addition to our growing suite of...

Satata Satez | Jun 18, 2025