我正在尝试在文本字段上显示我的日期选择器,这就是我所拥有的:
<%--importing jQuery for datepicker--%>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/redmond/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="//jquery-formatcurrency.googlecode.com/svn/trunk/jquery.formatCurrency.js"></script>
<asp:TableRow>
<asp:TableCell>
<label id="ReportFromLabel" runat="server">Report From Date:</label>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="ReportFrom" name="ReportFrom" runat="server"></asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<script type="text/javascript">
$(document).ready(function () {
<%--date jQuery--%>
$("#ReportFrom").datepicker({
showOn: "focus"
});
});
</script>
现在什么都不做......我错过了什么吗?或者只是完全忽略了一个明显的错误?
答案 0 :(得分:1)
$(document).ready(function () {
$("[id$=ReportFrom]").datepicker({
});
});
试试这个