WPIntell

Source evidence

Message validation

Contact Form Clean and Simple · support · 2021-09-16T12:04:00+00:00

complaintsentiment
highseverity
0.97relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 27 rows with source links

25.9% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Joshaw unresolved
Hello, Is it possible to add additional message validation to the form? I want the form to throw an error if the message contains a URL. For my other sites, which use contact form 7, it uses the ‘Disallowed Comment Keys’ field in the Discussion settings of WordPress and for sites using gravity forms I have used a filter to hook into field validation as shown below. Is it possible to do something similar with this form plugin? Thanks Jo Gravity forms validation: // add custom validation to form add_filter( 'gform_field_validation_1_4', 'validate_1_4', 10, 4 ); function validate_1_4( $result, $value, $form, $field ) { $nourl_pattern = '(===|http|https|www)'; if ( preg_match( $nourl_pattern, $value ) ) { $result['is_valid'] = false; $result['message'] = 'Message can not contain special characters or website addresses.'; } return $result; } There is a filter cscf_spamfilter you could use It basically stops the email being sent, it wont reject back to the user, you will have to manage what you do with the message. If you want to validate and respond to the user, as per your example, the a filter or action hook would need to be added to cscf_Contact->IsValid() If you want to contribute such code, then you can here https://github.com/alanef/plugin-clean-and-simple-contact-form-project This reply was modified 4 years, 8 months ago by Alan Fuller .

Comments

1 shown
Alan Fuller 2021-09-16T15:08:00+00:00

There is a filter cscf_spamfilter you could use It basically stops the email being sent, it wont reject back to the user, you will have to manage what you do with the message. If you want to validate and respond to the user, as per your example, the a filter or action hook would need to be added to cscf_Contact->IsValid() If you want to contribute such code, then you can here https://github.com/alanef/plugin-clean-and-simple-contact-form-project This reply was modified 4 years, 8 months ago by Alan Fuller .