Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Ajax datepickers and database values

  1. #1
    Join Date
    May 2004
    Posts
    530
    Rep Power
    0

    Default Ajax datepickers and database values

    Does anyone know if there is any ajax datepickers that does more that just imput date but also allows you to pass date values from a database , then highlight days accordingly on then datepicker. I have been searching but can seem to find any examples online that works with data.
    "...men are that they might have joy."
    Nephi

  2. #2
    Join Date
    Aug 2002
    Posts
    6,223
    Rep Power
    0

    Default

    .
    PC - Ubuntu 15.04 64bit Desktop
    HP Pav G60-236US 3GB RAM Laptop, Ubuntu 15.04 64bit and Win7 Home

    "So Daddy, how come you telling me stealing not right when YOU copying DVDs? How come? How Come?"


    RIP Ramesh ...

  3. #3
    Join Date
    May 2004
    Posts
    530
    Rep Power
    0

    Default

    No not really. Something like one of those jquery ones but i want to be able for it to accept databse date values so i can make a date on the datepicker unselectable. I just want the datepicker to not only input date but also show me those days that were already selected, so i can make those days unselectabe.
    "...men are that they might have joy."
    Nephi

  4. #4
    Join Date
    Aug 2002
    Posts
    6,223
    Rep Power
    0

    Default

    What about this one? Uses PHP and mySQL
    http://www.opencrypt.com/blog.php?a=29
    .
    PC - Ubuntu 15.04 64bit Desktop
    HP Pav G60-236US 3GB RAM Laptop, Ubuntu 15.04 64bit and Win7 Home

    "So Daddy, how come you telling me stealing not right when YOU copying DVDs? How come? How Come?"


    RIP Ramesh ...

  5. #5
    Join Date
    May 2004
    Posts
    530
    Rep Power
    0

    Default

    This is a good start. thank you .
    "...men are that they might have joy."
    Nephi

  6. #6
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default

    Based on what you said it sounds like you should be writing you own calender picker in a popup window instead of using a plugin. It may work out to be less trouble and easier to maintian in the long run if you wrote a simple popup window.

  7. #7
    Join Date
    Oct 2009
    Posts
    785
    Rep Power
    0

    Default

    you can accept DB queries with the jquery ui date picker. There is an event called beforeShowDay which returns an array that indicates if the day is selectable.


    The function takes a date as a parameter and must return an array with [0] equal to true/false indicating whether or not this date is selectable, [1] equal to a CSS class name(s) or '' for the default presentation and [2] an optional popup tooltip for this date. It is called for each day in the datepicker before is it displayed.
    Code examples

    Supply a callback function to handle the beforeShowDay event as an init option.

    $('.selector').datepicker({
    beforeShowDay: function(date) { ... }
    });
    http://jqueryui.com/demos/datepicker/

    They date function can contain an ajax call that connects to the DB and return an array of invalid dates. Or you can build the array of invalid dates anyway you like.

  8. #8
    Join Date
    May 2004
    Posts
    530
    Rep Power
    0

    Default

    Quote Originally Posted by owen View Post
    Based on what you said it sounds like you should be writing you own calender picker in a popup window instead of using a plugin. It may work out to be less trouble and easier to maintian in the long run if you wrote a simple popup window.
    This could be the best solution but i do not know where or how to start been a young rooky developer.

    Quote Originally Posted by techie2000 View Post
    you can accept DB queries with the jquery ui date picker. There is an event called beforeShowDay which returns an array that indicates if the day is selectable.


    http://jqueryui.com/demos/datepicker/

    They date function can contain an ajax call that connects to the DB and return an array of invalid dates. Or you can build the array of invalid dates anyway you like.
    I like how this sounds. Is it possible that you could help me with a simple code snippet with a couple of date values passed to one month so i can see how it is set up. by the way is there a way to do something like this http://www.kelvinluck.com/assets/jqu...electWeek.html, ie select a week on one click, with this implementation of jquery datepicker
    Last edited by leocrawf; Jan 4, 2010 at 11:57 AM.
    "...men are that they might have joy."
    Nephi

  9. #9
    Join Date
    Oct 2009
    Posts
    785
    Rep Power
    0

    Default

    Quote Originally Posted by leocrawf View Post
    This could be the best solution but i do not know where or how to start been a young rooky developer.



    I like how this sounds. Is it possible that you could help me with a simple code snippet with a couple of date values passed to one month so i can see how it is set up. by the way is there a way to do something like this http://www.kelvinluck.com/assets/jqu...electWeek.html, ie select a week on one click, with this implementation of jquery datepicker
    I dont have any code samples on hand, I found these examples using Google, they are pretty straight forward if you are familiar with jquery. I will try to throw together a simple example later on, if you still need assistance...


    http://blog.eschedule.ca/post/2008/1...le-states.aspx

    http://groups.google.com/group/jquer...00974f79?pli=1 -> this is a pretty good example

    http://wtf.hax.is/2008/05/jquery-dat...selectbox.html

  10. #10
    Join Date
    May 2004
    Posts
    530
    Rep Power
    0

    Default

    Thanks a whole lot for your help. Now i can finally try and put together something, spent all weekend searching. One other thing though, do you know if i can do the hover week trick to give the impression that a full week is select like this: http://www.kelvinluck.com/assets/jqu...electWeek.html. This example link is for another implementation of jquery datepicker but it does not have as much documentation and examples onlne. The week selection feature would be the topping if this implementation of the jquery datepicker could do it. Any ideas?
    Last edited by leocrawf; Jan 4, 2010 at 01:43 PM.
    "...men are that they might have joy."
    Nephi

Posting Permissions

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