javascript - input propertyChange not working with jQuery datepicker -


i using jquery ui datepicker widget , have script supposed act on inputs when values change. binds 'input propertychange' inputs , 'change' selects.

the problem datepicker widgets gets event when user manually types datepicker's text box. if use ui calendar pick date it, input's value indeed change event never fires!

then noticed apply 'onselect' option datepicker not seemt o work existing datepicker, so:

if (input.hasclass('hasdatepicker')) {                         input.datepicker({                             onselect : function (datetxt, element) {                                 alert('updated '+datetxt);                             }                         });                     } 

the alert never comes, guess because expects apply onselect when widget created.

but trying create universal script attaches pages required need loosely coupled. way datepicker seems funciton rigid , not lend being flexible. tried adding explicit onselect on each datepicker need , in onselect calling .change() on in hopes of @ least getting trigger universal input propertychange handler still doesn't work!

any other ideas on how can external handler pick datepicker updates without coding explicitly each , every datepicker ??

maybe looking for:

$(document.body).on('change keyup','.datepicker',function(){         alert('updated ' + this.value) }); 

http://jsfiddle.net/qebkb/6/


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -