$dispError .= " <b>·</b> To prevent abuse you must wait 2 minutes before submitting again.<br>"; } } if ($countErrors == 0) { $arrColumns = array("submitdate", "ipaddress", "customform_id"); $arrValues = array(time(), $IP_ADDRESS, $customPageInfo['customform_id']); if ($customFormObj->objSubmission->addNew($arrColumns, $arrValues)) { $submissionInfo = $customFormObj->objSubmission->get_info(); foreach ($arrComponents as $componentID) { $customFormObj->objComponent->select($componentID); $componentInfo = $customFormObj->objComponent->get_info_filtered(); if ($componentInfo['componenttype'] == "separator") { continue; } $formComponentName = "customform_" . $componentID; $arrSelectValues = $customFormObj->getSelectValues($componentID); // Check if required if ($componentInfo['required'] == 1 && $componentInfo['componenttype'] != "multiselect" && trim($_POST[$formComponentName]) == "") { $countErrors++; $dispError .= " <b>·</b> " . $componentInfo['name'] . " may not be blank.<br>"; } elseif ($componentInfo['required'] == 1 && $componentInfo['componenttype'] == "multiselect") { $countMultiSelect = 0; foreach ($arrSelectValues as $selectValueID) { $multiSelectName = $formComponentName . "_" . $selectValueID; if ($_POST[$multiSelectName] == 1) { $countMultiSelect++; } } if ($countMultiSelect == 0) { $countErrors++; $dispError .= " <b>·</b> " . $componentInfo['name'] . " may not be blank.<br>";