Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I used the following Jquery to load calendar on clicking HREF but it does not work can any one tell why

XML
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<a class="click-on-link" href="#">show datepicker</a>


My Jquery is as follows

XML
<script type="text/javascript">
function showDate(date) {
  //alert('The date chosen is ' + date);
}
$(function() {
  $('#ctl00_ContentPlaceHolder1_TextBox2').datepick();
  // assign anonimous function as event handler and call showdate from it
  $('#clickOnIt').click( function() {
    showDate( $(this).val() );
  } );
});
</script>


Can any one tell what to do
Posted
Comments
Sandeep Mewara 27-May-11 6:26am    
Any error?
demouser743 27-May-11 6:29am    
No errors i am unable to load the calendar the one i used is from here http://keith-wood.name/datepick.html i also tried this http://hackingon.net/files/jquery_datepicker/open_on_image.htm but on master page it is not getting

1 solution

This gives me a solution

Script

XML
<script type="text/javascript">
$(function() {
    $('#ctl00_ContentPlaceHolder1_TextBox1').datepick();
});
function showDate(date) {
    //alert('The date chosen is ' + date);
}
    </script>



XML
<a onclick="$('#ctl00_ContentPlaceHolder1_TextBox1').datepick('show');" >
    <img src="calendar.gif" />
    </a>



But if i had my tab on the textbox calendar is raising how can i disable this
 
Share this answer
 

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