PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

DatePicker do not allow past dates

  1. Hello
    I really need help with this thing i tried everything with no success .
    i want the datepicker past dates in my form to be greyed out , that no one can select past dates just like the brits have done it in this website --> http://thebritishtaxi.com/book-now/?zb=book2
    exactly i want it as their *start date* .

    my form located here --> http://vienna-taxis.com/order-vienna-taxi/

    thanks for the help .

    Posted 12 years ago on Friday December 14, 2012 | Permalink
  2. What have you tried so far?

    Please see this discussion: http://stackoverflow.com/q/1786411

    Posted 12 years ago on Friday December 14, 2012 | Permalink
  3. Thanks Chris , i have seen that and all discussions about it , here and many other places , nothing have worked for me yet .

    thanks

    Posted 12 years ago on Saturday December 15, 2012 | Permalink
  4. David Peralty

    Can you implement one of the solutions so we can see why it isn't be applied to your form?

    Posted 12 years ago on Monday December 17, 2012 | Permalink
  5. the following is in the head

    $(function () {
        $("#datepicker").datepicker({ minDate: 0 });
    });

    thanks

    Posted 12 years ago on Monday December 17, 2012 | Permalink
  6. David Peralty

    Can you try:

    $(function () {
        $(".datepicker").datepicker({ minDate: 0 });
    });
    Posted 12 years ago on Monday December 17, 2012 | Permalink
  7. thanks for the help David
    i changed it and still allows past dates ,

    Posted 12 years ago on Monday December 17, 2012 | Permalink
  8. I get a JavaScript error on that page:

    Timestamp: 12/17/2012 1:48:06 PM
    Error: TypeError: $ is not a function
    Source File: http://vienna-taxis.com/order-vienna-taxi/
    Line: 98

    You will need to do something like this instead, because you cannot use $ like that for jQuery in WordPress:

    [html]
    <script type="text/javascript">
    jQuery(document).ready(function($) {
        $(".datepicker").datepicker({ minDate: 0 });
    });
    </script>

    Try that and we will check the page again.

    Posted 12 years ago on Monday December 17, 2012 | Permalink
  9. wow , thanks chris , perfect !
    anyway to fix the less than < on the top left corner ?

    thanks very very much for the help !

    Posted 12 years ago on Monday December 17, 2012 | Permalink
  10. it has overwritten my date format from dd/mm/yyyy to mm/dd/yyyy

    Posted 12 years ago on Monday December 17, 2012 | Permalink
  11. all fixed except the less than < thing on the top left corner but that is not so important , for other who might face this problem thanks to Chris here it is

    <script type="text/javascript">
    jQuery(document).ready(function($) {
        $(".datepicker").datepicker({ minDate: 0,dateFormat: 'dd/mm/yy' });
    });
    </script>
    Posted 12 years ago on Monday December 17, 2012 | Permalink
  12. It seems to me you fixed the < ? That was probably just a stray one left over from copying and pasting. Did you find it?

    Posted 12 years ago on Tuesday December 18, 2012 | Permalink
  13. No, it is just the label <prev which shows up . and the calendar icon disappeared for some reason .

    Posted 12 years ago on Tuesday December 18, 2012 | Permalink