I have an input text containing a default date and I'm using jQuery's Datepicker plugin to select a date from a popin calendar. This calendar pops in when the user clicks on the small picture next to the input.
This is working great but I'd like to trigger the calendar's popin even when the user clicks on the input text. Long story short, I want the calendar to be displayed on both evenements.
Is it possible ? How ?
Thank you !
You just need to set the showOn
option to "both"
(rather than "focus"
or "button"
), like this:
$( "#datepicker" ).datepicker({
showOn: "both",
buttonImage: "calendar.gif",
buttonImageOnly: true
});
You can try it out here.
Try to trigger the button event in the input event handler, something lik ethat:
jQuery("#myinput").click(function(e){
jQuery("#mybtn").trigger('click');
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With