views:

87

answers:

1

Maybe I'm asking a really stupid question here but how do I update an input field with a date if the datepicker is attached to a div. Don't want to use the altField function as I want to use this to display a user friendly output to the site user.

Thanks

+1  A: 

You can use altField for hidden input and bind to this hidden change event to do something else (aka. show user friendly output).

$('.selector').datepicker({ altField: '#actualDate' });
$('#actualDate').change(function(){ ... });

Or use events.

$('.selector').datepicker({
   onSelect: function(dateText, inst) { ... }
});
dario-g
Thanks Dario, but could you please show me a code example of what you mean.
Darren Cook
I edit my answer.
dario-g