Forums

Date validation and limitation

tiesgr 29 Mar, 2014
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.
Max_admin 30 Mar, 2014
Hi tiesgr,

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

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tiesgr 30 Mar, 2014
Nope, unfortunately still looking and searching about that.
tiesgr 30 Mar, 2014
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.
tiesgr 31 Mar, 2014
Well admin are you willing to help me or you were just curious?
GreyHead 31 Mar, 2014
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
Max_admin 31 Mar, 2014
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, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tiesgr 31 Mar, 2014
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.
tiesgr 31 Mar, 2014
Hello again,
Please excuse me for not answering what version of chronoforms do I use. I use V5
tiesgr 31 Mar, 2014
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.
tiesgr 31 Mar, 2014
Can someone take over it? If yes how much would that cost?
tiesgr 31 Mar, 2014
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.
Max_admin 31 Mar, 2014
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, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.