Forums

check date te open close form

wiva 05 Oct, 2020
I am migrating a chronoforms v5 to v7.
In v5 I have a date check. The form should only be displayed and accessible on the days before or after the date in the config.
In the Event Switcher I have this code
<?php
$datetime1 = new DateTime();
$etdatum = $form->data['config']['pubendindiform'];
$datetime2 = new DateTime($etdatum);
//echo $etdatum;
if ($datetime1 > $datetime2)
{
return "fail";
// echo "<h2>Je bent helaas te laat om dit formulier in te vullen!</h2>";
}
//if ( isset($form->validation_errors) && count($form->validation_errors) > 0 )
{
// return "fail";
}
?>

How can I do this check in v7
Max_admin 05 Oct, 2020
v7 has a WatchMan behavior in the form settings to do that, please check it and let me know if you need help!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
wiva 05 Oct, 2020
Thank you,
Yes, I found the WatchMan behavior but:
  1. there seems to be a difference in time that i configure in the WatchMan and the local time (Netherlands). I think WachtMan is 2 hours behind. Is there a way to adjust the "WatchMan time"
  2. Is there a way to customize this message ?
  3. Or to redirect to a custom page?
Max_admin 06 Oct, 2020
#1- I think I found a bug at this part, you may wait for the next update to get it fixed!
#2- yes, there is a failure page setting at the watchman plugin, set it to a page in your form and it's going to open that page instead, make sure that page is inside it's own page group with type (standalone)
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.