javascript - Dynamic Date and Time -
i trying build appointment form. have used xdsoft jquery date , time picker. after selecting date checks appointments time , returns available time schedule ajax. when alert info result dont info in picker. help helpful. tnx
here's tried
demo without ajax
http://jsfiddle.net/4ppj2/1/
html
<form id="schedule_time_form" method="post" action="#"> <label>select date</label> <input type="text" id="datepicker_time" name="datepicker_time" class="input-medium"> <label>select time from</label> <input type="text" id="timepicker1_time" disabled name="timpepicker1_time" class="input-small"> </form>
jquery
var logic = function( currentdatetime ){ if( currentdatetime ){ var day = "day="+currentdatetime.getday(); $.ajax({ url : "helper/getdate.php", type: "post", info : day, success: function(data, textstatus, jqxhr) { $('#timepicker1_time').datetimepicker({ datepicker:false, format:'h:i', allowtimes:[data] }); }, error: function (jqxhr, textstatus, errorthrown) { } }); } }; $('#datepicker_time').datetimepicker({ mindate: 0, timepicker:false, format:'y-m-d', onchangedatetime:logic, inline: true, });
javascript jquery ajax datetime
No comments:
Post a Comment