Buy Now
Sign in

Date validation on Submit

cmwincom , March 18 2014
C
cmwincom 16
March 18 2014 #326858
I am wondering if it is possible to compare the date a form is submitted to a set deadline date. The idea is that when a visitor clicks submit it compares the date of submission to the deadline date.

For example I have a form for a scholarship application. The deadline for the submission is April 11th. I would like it that when the visitor clicks submit if the date is April 12th or later a message pops up informing them that the online submission deadline has passed. Or another option would be to hide the submit button after April 11th and display a message instead.

Is this possible. If so, how would I do it?
calculus00 1.0
March 18 2014 #326859
Hello cmwincom,
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.
GreyHead 63.4
March 19 2014 #326893
Hi cmwincom,

For CFv4 you can use my Watchman [GH] action that lets you set 'publish' and 'unpublish' dates for a form.

Bob

PS The action should be OK on Joomla! 2.5 but might need updating for Joomla! 3. Please let me know if you have any problems.
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
C
cmwincom 16
March 19 2014 #326907
Hello GreyHead,

I have installed your custom action. The question now is where do I use it? Do I put it in the On Load or the On Submit section under events?
GreyHead 63.4
March 19 2014 #326914
Hi cmwincom,

At the beginning of the form On Load event is the usual place.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
C
cmwincom 16
March 19 2014 #326919
GreyHead,

That is what I thought and what I did. I've set the open date as 2014-03-21 and the close date as 2014-04-21. However, when I browse to the page with the form, the form displays. Any suggestions?
GreyHead 63.4
March 26 2014 #327423
Hi cmwincom,

Do you have an Event Loop action in the pink On Fail event of the Watchman action?

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
C
cmwincom 16
March 27 2014 #327574
No I don't. How should I do that.

I've attached a screen capture of my on load section.

chrono.png
Attachments
chrono.png
chrono.png
(3.78 KiB)
166 Downloads/Views
GreyHead 63.4
March 27 2014 #327596
Hi cmwincom,

Just drag an Event Loop action into the pink Denied action (I'd forgotten it was denied and not On Fail).

That will re-load the form on failure. Instead of the Event Loop you could use a ReDirect; or a Custom Code plus a Show Stopper to show a message.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much