开发者

Simple jQuery UI DatePicker question

开发者 https://www.devze.com 2022-12-18 10:40 出处:网络
Maybe I\'m asking a really stupid question here but how do I update an input field with a date if the datepicker is attached to a div. Don\'t want to use the altField function as I want to use this to

Maybe I'm asking a really stupid question here but how do I update an input field with a date if the datepicker is attached to a div. Don't want to use the altField function as I want to use this to display 开发者_运维知识库a user friendly output to the site user.

Thanks


You can use altField for hidden input and bind to this hidden change event to do something else (aka. show user friendly output).

$('.selector').datepicker({ altField: '#actualDate' });
$('#actualDate').change(function(){ ... });

Or use events.

$('.selector').datepicker({
   onSelect: function(dateText, inst) { ... }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消