Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using jquery datepicker and trying to display the date picker on the click of an image button but the calendar control is not displayed .. My jquery is working fine since i have tried using an alert statement

What I have tried:

I have downloaded the following jquery link and tried using the date picker control
HTML
<script src="jquery-3.3.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="Stylesheet" type="text/css" />
<script>
$(document).ready(function () {
   $("#imgbuttoncalender").click(function () {
      $("#datepicker").datepicker();
   });
});
</script>
I have also tried using datepicker.show()

my html code
HTML
<asp:Label ID="lbldob" runat="server" Text="Date of Birth"></asp:Label>
<asp:TextBox ID="tbdob" TextMode="DateTime" placeholder="dd/mm/yyyy" runat="server" style="margin-left: 64px"></asp:TextBox>
<asp:ImageButton ID="imgbuttoncalender" runat="server" Height="25px" ImageUrl="~/Images/calender.png" style="margin-left: 13px; margin-top: 0px" Width="29px"></asp:ImageButton>
<input type="text" id="datepicker" />
Posted
Updated 1-Jan-20 17:29pm
v2

hello try this link for datepicker

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
 
Share this answer
 
To get a date you must first ask. You should use jsfiddle or google because this is a simple common question. Simple jQuery UI Datepicker example - JSFiddle[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900