class Form.Element.Observer

Description

An Abstract.TimedObserver subclass that watches for changes to a form field's value. This triggers the callback when the form field's value (according to Form.Element.getValue) changes. (Note that when the value actually changes can vary from browser to browser, particularly with select boxes.)

Methods

Constructor

new Form.Element.Observer(element, frequency, callback)
  • element (String | Element) – The form element to watch. Can be an element instance or an ID.
  • frequency (Number) – The frequency, in seconds — e.g., 0.33 to check for changes every third of a second.
  • callback (Function) – The callback to trigger when the value changes.

Creates a Form.Element.Observer.