I have this:
<script>
$(function() {
$( "#datepicker" ).datepicker({
dateFormat : "yy-mm-dd",
onSelect: function(dateText) {
$.post('/admin/deals/booking/',
{ date: dateText }, function(data) {
if(data != '0')
{
$('input[name=book_date]').val(dateText);
$('#results').html(data);
$('.current_text').html(dateText);
$('.book_deal').removeAttr("disabled");
}
});
}
});
$( "#button" ).bind('click', function(){
});
});
</script>
I want when pressing on #button it should activate the above #datepicker, like you have clicked on the date and selected date 2012-02-02
How can this be done?
According to the docs, datepicker provides is a
setDatemethod: