使用 jquery datepicker ui,相关 html 字段的值属性不会立即更新。
Example: http://jsfiddle.net/4tXP4/
From the horses mouth: http://jqueryui.com/demos/datepicker/alt-field.html
如果您检查元素,您会发现两个值属性都没有更新。
这些缺少什么?
最佳答案
如果您不想要另一个输入字段,则使用 onSelect
但 .val
函数不会更新 value
属性,因此您需要更原始一点
$("#datepicker_start").datepicker({
onSelect: function(dateText, datePicker) {
$(this).attr('value', dateText);
}
});
关于javascript - jquery ui datepicker 不更新值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11381994/