I dont know where to put this so im sorry if its in the wrong place to start!
I have a date picker that inserts into a datebase a number of days in one column so for example:
datearriving would have: 11-8-2012, 12-08-2012, 12-8-2012
What im struggling with is calling the values from the database to grey out the days in my form. Any ideas???
PHP Code:
[code=php]
var disabledDays = [
<?php while ($row = mysql_fetch_array($grey, MYSQL_ASSOC)) {
echo ‘”‘ . $row[‘datearriving’] . ‘”,’;
}
?>
];
/* utility functions */
function nationalLeavingDays(date) {
var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();
for (i = 0; i < disabledDays.length; i++) {
if($.inArray((m+1) + ‘-‘ + d + ‘-‘ + y,disabledDays) != -1 || new Date() > date) {
return [false];
}
}
return [true];
}
function noWeekendsOrLeavingHolidays(date) {
return nationalLeavingDays(date);
}
/* create datepicker */
jQuery(document).ready(function() {
function displayVals() {
var numdays = $(“#num_days”).val();
jQuery(‘#datepicker’).multiDatesPicker({
mode: ‘daysRange’,
autoselectRange: [0,numdays]
});
}
$(“#num_days”).change(displayVals);
displayVals();
});
Any help would be golden!
thanks!