Buy Now
Sign in

Date validation and limitation

tiesgr , March 29 2014
T
tiesgr
Hello I would like to validate two datepicker fields in order not the second to be in an older date than the first and of course the first date not to be in the past. Another option would be to limit the dates for the user to choose only Saturdays. So the dates would be from this Saturday to next Saturday or the Saturday after the next Saturday depending of how many weeks the user needs. But it must be only from Saturday to another Saturday. Is that Possible?
Please assistance needed asap.
calculus00
Hello tiesgr,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I format a date in the datepicker?
How can I set a default date for a datepicker?
How can I set start and end dates for a datepicker?
P.S: I'm just an automated service
I'm an automated service, my answers may help, but they may not be accurate.
admin
Hi tiesgr,

Did you find any of the links posted by Calculus helpful ?

Regards,
Max
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
T
tiesgr
Nope, unfortunately still looking and searching about that.
T
tiesgr
I only found useful this topic but I want it to go a bit further. I only want Saturdays to be allowed and when I check date from the first datepicker then the second must show the next Saturday as default and all the other Saturdays after that available.
T
tiesgr
Well admin are you willing to help me or you were just curious?
GreyHead
Hi tiesgr,

Which version of ChronoForms are you using?

I think that probably the only way to do this is with custom JavaScript. In CFv4 the datepicker has some built in methods that are useful - check the FAQs for some examples, I'm not sure if they exist in CFv5.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
admin
I was trying to find out if you managed to find the info you need, Bob has more experience with the date picker settings and he wrote that FAQ, but the date picker script used is here:
http://mootools.net/forge/p/mootools_datepicker

Please check the available settings/options and see if any of them can help do what you need ? if not then it will be hard to do it, but there will be 2 approaches:

#1- you do it using PHP validation, just ask the user to select Saturdays..etc, and check if they made a valid selection on submit.

#2- you give me some time to add the feature to the v5 date picker, not sure how much time will be needed to add it though, but you can contact me about this using the "contact us" page.

Regards,
Max
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
T
tiesgr
Hello Gray Head,

Yes I could use some javascript but mootools datepicker have it's own syntax. For example how can I create a conditional take for example the name of the day and if it's not Sat then disable it. something like:

<script>
  var onlySat = function satAvail(){
if (get.date='Mon'|| get.date='Tue'|| etc..)
{disablethem}};

var end_date = new Date().increment('week', 5);//and then regarding the mootools syntax.
  var picker = new Picker.Date($$('input'), {
    maxDate:end_date,
    format:'%d-%m-%Y',
pickOnly:onlySat,
    pickerClass: 'datepicker_dashboard',
    columns: 1,
    timePicker: true
  });
  date = new Date($$('input').get('week'),{
  
  });
  </script>


this is just an example Just to explain the rule for Only Saturdays.
T
tiesgr
Hello again,
Please excuse me for not answering what version of chronoforms do I use. I use V5
T
tiesgr
Gray Head the options according to this guide are working in 5v. I don't want a php validation I would like a javascript validation in order the validation to be done in real time not on submit. For example I want all the days of the datepicker to be disabled except Saturdays. That can be only done, in real time, with javascript on load.
T
tiesgr
Can someone take over it? If yes how much would that cost?
T
tiesgr
Admin,

The faq that you send me it doesn't give me any example for disabling days and allowing others. I am searching through the web for two days now and still haven't got the idea of how can I do that.
admin
Hi Tiesgr,

Please send me a message using the "contact us" page and let me know when do you need this feature.

Regards,
Max
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!