Datepicker onfocus Event in jquery
I need to show datepicker onfocus Textbox event in Jquery. Here's the code but not working
$("#payment_date").focus(function() {
$("#payment_date").datepicker("show");
});
+3
archu
source
to share
2 answers
The DatePicker in jQuery UI automatically binds to the focus of the input element. You don't need to link it again.
Just works:
$(function() {
$('#payment_date').datepicker();
});
Should be enough.
+2
BenM
source
to share
$("input[id$=datepicker]").datepicker({});
Try this, it works great.
+1
Jeyachandran
source
to share