How do I make the jQuery Datepicker open up by a user defined button?
+4
A:
There's built-in support for this, having an icon or button to right right of the textbox, like this:
$("#datepicker").datepicker({
showOn: 'button',
buttonImage: 'images/calendar.gif',
buttonImageOnly: true
});
If you want to show it from another button, or really any event, call the show
method, like this:
$("#myButton").click(function() {
$("#datepicker").datepicker("show");
});
Nick Craver
2010-07-10 13:35:44
Thanx bro..!! let me try anyways..
pvaju896
2010-07-10 13:53:50
is there any problem wen i use the same with ASP.NET user-controls. ???
pvaju896
2010-07-10 13:54:23
@pvaju896 - Nope...how are you calling it? Keep in mind that in a user control the ID will be different, you should use classes instead
Nick Craver
2010-07-10 13:59:35
you meant JQUERY classes..?? am new to JQUERY..how can i set class so..?/?? i made user control with just a textbox registered to aspx page and called the usercontrol..i tried giving datepicker for that usercontrol textbox --> it dint wrk dats y..??wat should i do now..?/ how to do with classes??
pvaju896
2010-07-11 05:44:45
+2
A:
The samples page as an example of how to make the datpicker appear by clicking an icon:
smack0007
2010-07-10 13:37:08