www.webdeveloper.com
Results 1 to 2 of 2

Thread: Datepicker help needed

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    88

    Datepicker help needed

    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:

    var disabledDays = [

    <?php while ($row mysql_fetch_array($greyMYSQL_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();
    });


    Thanks

  2. #2
    Join Date
    Sep 2011
    Posts
    58
    It is SQL forum... It looks like your question about PHP...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles