Page 1 of 1

jQuery Date Picker

Posted: Sun Jun 17, 2018 11:57 am
by ruel.lago22
Good day everyone,

I was wondering how can we disable past dates on jQuery Date Picker? And if possible require it before the form can be sent? I don't find any options in WWB14. I found some codes on the internet but I have no idea such as https://stackoverflow.com/questions/835 ... past-dates But uhmmm... I don't know where to insert it. I tried inserting it on the object html and page html but nothing works :shock: Does anyone already done this using WWB?

Re: jQuery Date Picker

Posted: Sun Jun 17, 2018 12:26 pm
by [RZ]

Re: jQuery Date Picker

Posted: Sun Jun 17, 2018 12:51 pm
by BaconFries
Simple if you wish to disable dates you can use minDate:0 this will disable all past dates as from the current date.
Add date picker to page open its properties in Custom Options->Options add minDate:0

Re: jQuery Date Picker

Posted: Mon Jun 18, 2018 5:31 am
by ruel.lago22
BaconFries wrote: Sun Jun 17, 2018 12:51 pm Custom Options->Options add minDate:0
I didn't know that it could be that simple :shock: . I made it minDate:0, maxDate: 7 and it worked fantastically beautiful! Maybe I am asking too much but I don't find any options to add some validation using jQuery Date Picker. I would require them to fill this before they can submit the form. Do you have anything you can share? I don't mean to be a spoon feed brat but I really have no idea. I'm scavenging bunch of codes on the internet and trying them and wishing best of luck if it will work :oops: Thank you in advance!

Screenshot: http://prntscr.com/jw5ank

Re: jQuery Date Picker

Posted: Mon Jun 18, 2018 5:51 am
by Pablo
The full documentation of the jQuery Date picker can be found here:
http://api.jqueryui.com/datepicker/

Re: jQuery Date Picker

Posted: Mon Jun 18, 2018 6:23 am
by ruel.lago22
Thank you Pablo :) I'll try my best to understand this codes and how to integrate them.

Re: jQuery Date Picker

Posted: Mon Jun 18, 2018 7:47 am
by BaconFries
There is a jQuery plugin named jQuery Validator available that allows validation to be put datepicker take a look at the following url. To test scroll till you see the submit button trying clicking to see results
http://keith-wood.name/uidatepickervalidation.html

Re: jQuery Date Picker

Posted: Mon Jun 18, 2018 10:52 am
by ruel.lago22
BaconFries wrote: Mon Jun 18, 2018 7:47 am There is a jQuery plugin named jQuery Validator available that allows validation to be put datepicker take a look at the following url. To test scroll till you see the submit button trying clicking to see results
http://keith-wood.name/uidatepickervalidation.html
Oh dear. My brain would like to explode. I'm out using jQury Date Picker. Maybe I'll study this in the future and integrate them on my website. As much I would like to use them but... I will go back to using editbox (date) so that I can connect it with my database and add conditions more easily :idea: But I was wondering. Where can I put the "minDate:0, maxDate:7" here? I don't see any options.

BaconFries. I would like to express my gratitude to you for going extra-mile in helping me with this. God bless you!

Re: jQuery Date Picker

Posted: Mon Jun 10, 2019 11:52 am
by ruel.lago22
Hi Pablo!

I was using "minDate:0, maxDate:7" before in jQuery Date picker>> option and it worked. Now it's no longer working.

Regards,
Ruel

Re: jQuery Date Picker

Posted: Mon Jun 10, 2019 11:57 am
by Pablo
The date picker has not changed recently. Maybe there is conflict with other code on your page?

Re: jQuery Date Picker

Posted: Tue Jun 18, 2019 6:37 pm
by Magical
Having a similar problem with validation. Is there a way to validate the date on the server? In my case the user can simply not select any date and submit the form. When I try to evaluate the date in the php code the server throws an error as undefined variable.

I just need to prevent the user from submitting the form without clicking on a date. Any thoughts?

For the gentleman who was looking for min and max dates here is what works for me:
I added this line to the custom options on the datepicker control:

defaultDate: "+3d",
minDate: "+3d",
beforeShowDay: $.datepicker.noWeekends

I wanted to set the default date 3 days from today
minDate user can select is also set at 3 days from today (it is an appointment setting application)
And I do not want them to pick weekends.

Re: jQuery Date Picker

Posted: Tue Jun 18, 2019 6:55 pm
by Magical
Nevermind, I figured it out how to handle it on the server.

Custom form processing
If (empty($_POST["datePicker1"])) { send to error.html };

Great product Pablo! Appreciate it a lot.

Re: jQuery Date Picker

Posted: Tue Jun 25, 2019 1:57 pm
by windsurfer
I looked in the Ready to use Java scripts but can't find the date picker. Where would i look ?
Never mind. found it