How to set error message in element php validation?

I use php to validate an element using the php validate plugin. Is there a way I can set the error message field from within my php code rather than using the static error message field in the plugin?

Thanks for your help.

Regards, Mark.
 
Hi - That wasn't possible, but sounds like a pretty useful thing to do, so in the last github commit I've added a setMessage($msg) method to the validation class.

So in you PHP validation code you can do:

PHP:
$this->setMessage('custom error message');
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top