Håkon Nordli
Nov 25, 2015
  5881
(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
Integrating Optimizely DAM with Your Website

This article is the second in a series about integrating Optimizely DAM with websites. It discusses how to install the necessary package and code t...

Andrew Markham | Sep 28, 2024 | Syndicated blog

Opticon 2024 - highlights

I went to Opticon in Stockholm and here are my brief highlights based on the demos, presentations and roadmaps  Optimizely CMS SaaS will start to...

Daniel Ovaska | Sep 27, 2024

Required fields support in Optimizely Graph

It's been possible to have "required" properties (value must be entered) in the CMS for a long time. The required metadata haven't been reflected i...

Jonas Bergqvist | Sep 25, 2024

How to write a bespoke notification management system

Websites can be the perfect vehicle for notifying customers of important information quickly, whether it’s the latest offer, an operational message...

Nicole Drath | Sep 25, 2024