Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 08, 2013 01:53 AM by Thiv
Member
5 Points
45 Posts
Jan 07, 2013 11:22 AM|LINK
Hi all my datepicker is not appearing when I click on thet textbox. My jquery files are stated in the master page. Below are my codes. Thanks a lot!
<asp:Content id="Content1" ContentPlaceholderID="ChildContent1" runat="server"> <script type="text/javascript">
$(function () {
$("#<%= GridView1.ClientID %>").find("[id$='txtPatDob']").attr("readonly", "true"); $("#<%= GridView1.ClientID %>").find("[id$='txtPatDob']").datepicker({ maxDate: '0', dateFormat: 'dd-mm-yy', changeMonth: true, changeYear: true, yearRange: '1905:2013'
});
</script>
<asp:GridView ID="GridView1" runat="server" Width = "100px" HeaderStyle-HorizontalAlign="Justify">
<asp:TemplateField HeaderText="DOB" HeaderStyle-HorizontalAlign="Center" ControlStyle-Width="50px"> <EditItemTemplate> <asp:TextBox ID="txtPatDob" runat="server" Text='<%#Bind("patientDOB") %>' Width="50px"></asp:TextBox> </EditItemTemplate> <ItemTemplate> <%# Eval("patientDOB")%> </ItemTemplate> </asp:TemplateField>
</asp:GridView>
</asp:Content>
104 Points
20 Posts
Jan 07, 2013 12:13 PM|LINK
$(function () { $("[id$=txtPatDob]").datepicker({ showOn: 'button', buttonImageOnly: true, buttonImage: 'http://jqueryui.com/demos/datepicker/images/calendar.gif' }); });
Try This Way
Jan 07, 2013 01:42 PM|LINK
Hi. It still does not seem to be working.
Jan 08, 2013 01:53 AM|LINK
The problem was with the textbox Id's.
$('input[id*=txtPatDob]').attr("readonly", "true"); $('input[id*=txtPatDob]').datepicker({ maxDate: '0',
Thiv
Member
5 Points
45 Posts
Jquery UI datepicker not showing up in asp.net gridview edit field
Jan 07, 2013 11:22 AM|LINK
Hi all my datepicker is not appearing when I click on thet textbox. My jquery files are stated in the master page. Below are my codes. Thanks a lot!
<asp:Content id="Content1" ContentPlaceholderID="ChildContent1" runat="server">
<script type="text/javascript">
$(function () {
$("#<%= GridView1.ClientID %>").find("[id$='txtPatDob']").attr("readonly", "true");
$("#<%= GridView1.ClientID %>").find("[id$='txtPatDob']").datepicker({
maxDate: '0',
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
yearRange: '1905:2013'
});
});
</script>
<asp:GridView ID="GridView1" runat="server" Width = "100px" HeaderStyle-HorizontalAlign="Justify">
<asp:TemplateField HeaderText="DOB" HeaderStyle-HorizontalAlign="Center" ControlStyle-Width="50px">
<EditItemTemplate>
<asp:TextBox ID="txtPatDob" runat="server" Text='<%#Bind("patientDOB") %>' Width="50px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<%# Eval("patientDOB")%>
</ItemTemplate>
</asp:TemplateField>
</asp:GridView>
</asp:Content>
Hiren Chavda
Member
104 Points
20 Posts
Re: Jquery UI datepicker not showing up in asp.net gridview edit field
Jan 07, 2013 12:13 PM|LINK
$(function () { $("[id$=txtPatDob]").datepicker({ showOn: 'button', buttonImageOnly: true, buttonImage: 'http://jqueryui.com/demos/datepicker/images/calendar.gif' }); });Try This Way
Thiv
Member
5 Points
45 Posts
Re: Jquery UI datepicker not showing up in asp.net gridview edit field
Jan 07, 2013 01:42 PM|LINK
Hi. It still does not seem to be working.
Thiv
Member
5 Points
45 Posts
Re: Jquery UI datepicker not showing up in asp.net gridview edit field
Jan 08, 2013 01:53 AM|LINK
The problem was with the textbox Id's.
$(function () {
$('input[id*=txtPatDob]').attr("readonly", "true");
$('input[id*=txtPatDob]').datepicker({
maxDate: '0',
});
});