引导日期选择器与Asp.Net文本框 [英] Bootstrap Datepicker with Asp.Net Textbox
问题描述
也许这将是一个愚蠢的问题,但我不能处理我的问题。我查了所有的问题和答案在这里,但我没有找到任何线索。无论如何,我想使用asp.net文本框引导日期选择器。当我输入不需要使用=服务器标签,我看到日期选择器显示出来,但是当我尝试使用带有runat =服务器标签文本框使用它时,日期选择器没有显示。关于如何解决此问题的任何想法?
Maybe it will be a silly question but I couldn't handle my problem. I checked all the questions and answers on here but I didn't find any clue. Anyway, I want to use the bootstrap datepicker with asp.net textbox. When I use it with input without the runat="server" tag, I see that the datepicker shows up, but when I try to use it with textbox with the runat="server" tag, the datepicker is not showing. Any idea on how to solve this issue?
<asp:TextBox ID="DateTextbox" runat="server" CssClass="m-wrap span12 date form_datetime"></asp:TextBox>
<script type="text/javascript">
$(document).ready(function () {
var dp = $("#<%=DateTextbox.ClientID%>");
dp.datepicker({
changeMonth: true,
changeYear: true,
format: "dd.mm.yyyy",
language: "tr"
});
});
</script>
谢谢您的回答。
推荐答案
谢谢您的回答。我做了一个可爱的小变化对我的code现在它的工作。我张贴继续使用。
thanks for your answers. i did a lil change on my code its working now. i am posting for further use.
<script type="text/javascript">
$(document).ready(function () {
var dp = $('#<%=DateTextbox.ClientID%>');
dp.datepicker({
changeMonth: true,
changeYear: true,
format: "dd.mm.yyyy",
language: "tr"
}).on('changeDate', function (ev) {
$(this).blur();
$(this).datepicker('hide');
});
});
</script>
但我不明白什么让之间()之探源和(')?
but i dont understand whats make the diffrence between (") and (') ?
这篇关于引导日期选择器与Asp.Net文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!