Home / Features / PHP Validation for Elementor Pro Form

PHP Validation for Elementor Pro Form

Share on

This feature requires the Elementor Pro plugin to work.

This extension will allow you to validate your form based on the conditions that you set. You can use the variable $fields to access field values (eg $fields[“field_id”]). The validation succeeds only if the PHP code does not return or return false. If it returns [$field_id, $error_message], then the error message will be reported for that specific field.

Elementor Pro plugin is not included.

Return an error if the date choice is before today

					if( $fields['date'] 

Accepts only time field between 7 PM and 10 PM

					if( $fields['time']  22 ) {
    return ['time', 'You must to choose a time between 7PM and 10PM' ];