This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
Time Validation
Started 12 years ago by tmparisi | 4 posts |
-
In version 3 is there a way to set a validation on the time? For example, if the user enters a value less than 4:00pm, an error will be displayed.
Also, can the 'AM' field be taken out of the dropdown?
Posted 12 years ago # -
I am assuming both of these would need to be done in the actual PHP...?
Posted 12 years ago # -
Anyone have a thought?
Posted 12 years ago # -
This is what was added to the post-functions.php file right above line 1367 ($form_unique_ip = $row['form_unique_ip'];).... thanks to MachForm it now works perfect:
if ($form_id == 2) {
//time validation
$time_element_id = 4;if (!empty($table_data['element_' . $time_element_id])) {
$time_extract = array();
$time_extract = explode(":",$table_data['element_' . $time_element_id]);if ($time_extract[0] < '16') {
$error_elements[$time_element_id] = 'Time only allowed more than 4PM';
}
}
}Posted 12 years ago #
Reply
You must log in to post.