How can I make a custom PHP validation script?

cheesegrits

Support Gopher
Sometimes you need to do custom validation on a form which just can't be done with a regular expression (regex).

As of SVN rev# 1032 of Fabrik 1.0.6, you can now raise validation errors from your form submit scripts, as long as they are "As soon as form is submitted (simple eval)", by setting ...

$arCustomErrors['table_name___element_name'][] = 'Some error message';

... in your submit script. You can set error messages for more than one element name. The form will then act exactly as if the specified element(s) had failed a normal Fabrik validation, i.e. it'll reshow the form, with the error message(s) next to the element(s) you specified in the array.

For a real life example, see this thread:

http://fabrikar.com/forums/showthread.php?p=40288#post40288

-- hugh
 
Nope, this doesn't apply to Fabrik 2, as we handle submission scripts and validations in a very different way.

In 2.0, you would write a validation plugin. There are several examples to work from in the com_fabrik/plugins/validation folder.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top