bootstrap Datepicker不能与asp.net文本框一起使用 [英] bootstrap Datepicker is not working with asp.net textbox
本文介绍了bootstrap Datepicker不能与asp.net文本框一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用带有asp.net文本框的bootstrap datepicker但是它给出了一个错误
I am trying to use bootstrap datepicker with asp.net textbox but it gives an error
TypeError: dp.datepicker is not a function
language: "tr"
这是我的代码
Here is my code
<script type="text/javascript">
$(document).ready(function () {
var dp = $('#<%=txt_date.ClientID%>');
dp.datepicker({
changeMonth: true,
changeYear: true,
format: "dd.mm.yyyy",
language: "tr"
}).on('changeDate', function (ev) {
$(this).blur();
$(this).datepicker('hide');
});
});
</script>
<div class="form-group col-md-5">
<label for="exampleInputPassword1">Date : </label>
<asp:TextBox ID="txt_date" runat="server" type="date"
CssClass='form-control' placeholder="YYYY-MM-DD" ClientIDMode="Static"></asp:TextBox>
</div>
提前感谢您的回答
Thanks in advance for your answers
推荐答案
(文件).ready(function(){
var dp =
(document).ready(function () { var dp =
('#<% = txt_date.ClientID %> ');
dp.datepicker({
changeMonth:true,
changeYear:true,
format:dd.mm.yyyy,
language:tr
})。on('changeDate',function(ev){
('#<%=txt_date.ClientID%>'); dp.datepicker({ changeMonth: true, changeYear: true, format: "dd.mm.yyyy", language: "tr" }).on('changeDate', function (ev) {
(this).blur();
(this).blur();
这篇关于bootstrap Datepicker不能与asp.net文本框一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文