Open form specific date

Maxvl 01 Dec, 2016
Hi, I would like to check the current date before showing a form. The form should be open specific days of the month for a year. In the remaining days of like 'Subscription closed'.

Example. The form is open from 7 to 10 each month for a year.
Can this be done?

Thanks in advance!
Max_admin 02 Dec, 2016
Hi Maxvl,

You can use an "Event switcher" action and the code below:

<?php
if(date("d") >=7 OR date("d") <= 10){
return "ok";
}


you should have an "ok" event in the event switcher with the "show html" action inside it.

You can read more about the event switcher here:
http://www.chronoengine.com/faqs/70-cfv5/5212-event-switcher.html

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Maxvl 02 Dec, 2016
Hi Max,
I made a test this morning by following your advice.
Unfortunately, the form is not closed for the entry.

I think I missed something. Please look at my 2 attached files.
img1, img2
GreyHead 02 Dec, 2016
1 Likes
Hi Maxvl,

The code you have here will only show the message - it won't close the form.

You would need to add the HTML (Render Form) action in the ok event and put a ShowStopper after the Event Switcher.

Personally I'd probably do this the other way round. Have a 'closed' event when the form is not open and add a Message + Show Stopper in there.

Bob
Maxvl 02 Dec, 2016
I use your advice. Thank you very much!
This topic is locked and no more replies can be posted.