![](/img/trans.png)
[英]Jquery datepicker - How do we hide the text inside a datepicker textbox?
[英]How can we initialise datepicker into a textbox which is appended by ajax
在PHP的yii框架中,我嘗試附加一個文本框,然后初始化datepicker。 我已經有兩個靜態文本框,且datepicker在from中運行良好,還需要添加兩個靜態文本框,並在這些文本框中初始化datepicker。
當我嘗試在ajax成功調用之后啟動程序時。 它顯示
日期選擇器不是功能
我的ajax電話:
$.ajax({
type: 'get',
url: url,
cache: false,
dataType: 'html',
success: function (html) {
$('.append_more_parents:last').append(html);
var num_form = parseInt($('.count').length + 2);
$('.count:last').text('Parental Responsibility ' + num_form);
$form = $('#appended_form');
$form.replaceWith($form.html());
container_id++;
$('#datepicker').datepicker();
},
error: function (err) {
bootbox.alert('Sorry adding of parental details failed! Please try again');
}
});
如果顯示“ datepicker不是函數”,似乎HTML頁面中不包含Jquery datepicker庫?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.