Form.Element.DelayedObserver

A delayed observer works like a normal observer, but the triggered callback is delayed. Every time the observed event is observed the internal timer is reset. Once the internal timer reaches the time set in the second parameter the callback is fired.

Syntax

Form.Element.DelayedObserver(element, time, callback)

element: the form element to observe
time: the internal timer after which the callback is fired (in seconds)
callback: the callback function.

Example code


new Form.Element.DelayedObserver($('inputbox'), 0.5, function(){
     //do your stuff here, like an ajax request
});