jQuery Date Picker

Issues related to forms.
Post Reply
User avatar
ruel.lago22
 
 
Posts: 59
Joined: Thu Feb 01, 2018 11:32 am

jQuery Date Picker

Post 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?
User avatar
[RZ]
 
 
Posts: 1914
Joined: Tue Nov 04, 2008 12:08 pm

Re: jQuery Date Picker

Post by [RZ] »

User avatar
BaconFries
 
 
Posts: 5316
Joined: Thu Aug 16, 2007 7:32 pm

Re: jQuery Date Picker

Post 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
User avatar
ruel.lago22
 
 
Posts: 59
Joined: Thu Feb 01, 2018 11:32 am

Re: jQuery Date Picker

Post 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
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: jQuery Date Picker

Post by Pablo »

The full documentation of the jQuery Date picker can be found here:
http://api.jqueryui.com/datepicker/
User avatar
ruel.lago22
 
 
Posts: 59
Joined: Thu Feb 01, 2018 11:32 am

Re: jQuery Date Picker

Post by ruel.lago22 »

Thank you Pablo :) I'll try my best to understand this codes and how to integrate them.
User avatar
BaconFries
 
 
Posts: 5316
Joined: Thu Aug 16, 2007 7:32 pm

Re: jQuery Date Picker

Post 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
User avatar
ruel.lago22
 
 
Posts: 59
Joined: Thu Feb 01, 2018 11:32 am

Re: jQuery Date Picker

Post 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!
User avatar
ruel.lago22
 
 
Posts: 59
Joined: Thu Feb 01, 2018 11:32 am

Re: jQuery Date Picker

Post 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
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: jQuery Date Picker

Post by Pablo »

The date picker has not changed recently. Maybe there is conflict with other code on your page?
User avatar
Magical
 
 
Posts: 111
Joined: Thu Dec 14, 2017 5:08 pm
Contact:

Re: jQuery Date Picker

Post 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.
User avatar
Magical
 
 
Posts: 111
Joined: Thu Dec 14, 2017 5:08 pm
Contact:

Re: jQuery Date Picker

Post 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.
windsurfer
 
 
Posts: 181
Joined: Mon May 13, 2019 9:15 pm

Re: jQuery Date Picker

Post 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
I used to have a photographic memory but i ran out of film !!!
Post Reply