I have a jQuery’s jQueryUI datepicker on a site. After the person chooses a date, I would like to display the date as text in a different div, such that:
1) Person chooses date and date appears in input box, then,
2) A new div shows and offers ‘Pick a time on (selected date):’
jQuery:
<script type='text/javascript'>
$(function(){
$('.date_panel,.time_panel').hide();
$('.svc_button').click(function(){
$('.svc_panel').fadeOut(function(){
$('.date_panel').fadeIn();
});
});
$('.time_button').click(function(){
$('.time_panel').fadeIn(function(){
});
});
});
</script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
html:
</div>
<div class="date_panel">
<p>Click here to pick a date: <input id="datepicker" class="time_button" type="text"></p>
</div>
<div class="time_panel">
<p>Pick a time on: <script type="text/javascript">document.write("<span>" + .datepicker( "getDate" ) + "</span>");</script></p>
The time will be listed from a separate source.
Please, be explicit.
http://jsfiddle.net/5PqQb/