Hi Support!
I want to create a suvey-like Form which the users should fill out every 24 hours. But not earlier if they have already submittend within the last 20 hours or on the same day or something like that.
I figured out with help of the Community forum that I need to use the onLoad php function. I tried but I honestly have no idea how to do it.
It is for scientific research in the field of psychology, part of my Master's thesis. A working code example would be a great help, I tried for several hours now.
I tried this with the onLoad function, but it doesn't work (don't know if it is anything near correct):
Regards
SR
P.S.: I'm running the latest version of Fabrik and Joomla.
I want to create a suvey-like Form which the users should fill out every 24 hours. But not earlier if they have already submittend within the last 20 hours or on the same day or something like that.
I figured out with help of the Community forum that I need to use the onLoad php function. I tried but I honestly have no idea how to do it.
It is for scientific research in the field of psychology, part of my Master's thesis. A working code example would be a great help, I tried for several hours now.
I tried this with the onLoad function, but it doesn't work (don't know if it is anything near correct):
PHP:
if (!$formModel->isNewRecord()) {
$db = JFactory::getDbo();
$timeDBentry = $formModel->formData['pdd_testlauf___date_time'];
$last_date = strtotime($timeDBentry);
$timeframe = strtotime("-20 hours");
if ($last_date >= $timeframe)
{ // less than 20 hours ago
return false;
}
} // more than 20 hours ago
return true;
Regards
SR
P.S.: I'm running the latest version of Fabrik and Joomla.