Formbuilder validation

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
kmesd62
Forum Members
Forum Members
Posts: 30
Joined: Sat Aug 06, 2011 3:17 pm

Formbuilder validation

Post by kmesd62 »

Hi
I have a site on Cmsms 2.2.16 and PHP 7.3.33 that's using FormBuilder 1.1, FormBrowser 0.5 and Captcha 1.0.1 (with reCAPTCHA v3).

There's an enquiry form containing:
• an ‘Email Results Based on Pulldown’ field,
• a textarea for the main enquiry detail
• other standard ‘contact’ fields, such as name, email etc, some including regexes
• a ‘Deposition to FormBrowser’ field

Some spam is still getting through and recipients would like it reduced to zero (or as close as reasonably practical).

As there are some distinct characteristics of the spam submissions, I was wondering about the practicalities of either or both of the following:
a) Intercepting the ‘automatic validation’ that’s on the main textarea input and adding a regex to only allow submissions that don’t contain the signature characteristics.
b) Allow all submissions, but skip the ‘Email results’ action for submissions containing any of the signature characteristic.

I'm thinking that a UDT might be involved and as it'll be my first, all guidance getting me up the learning curve gratefully received.

Thanks in advance
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Formbuilder validation

Post by velden »

This part from the help almost says it all:
Validation UDT. Set this for a form, and the UDT will receive all of the form's human-readable results. The UDT should do whatever validation it wants, and return an array with the first value being true or false (indication whether the form validates), and the second value being error messages (if any).
You can start the udt with

print_r($params);
die();

to see what information is available.

Also note that some fields already have a possibility to do a regex validation. Though that's limited compared to the possibilities with a UDT.
Post Reply

Return to “Modules/Add-Ons”