I'm trying to validate a group of checkboxes on a register form, they all have different names, so I need to write a custom validator that will do this. Problem is that the custom validator does not seem to work at all, this is what I have right now [for testing];
[[!Register?
<!-- simplified for clarity -->
&customValidators=`aiRequired`
&validate=`
box-a:aiRequired,
username:required,
password:required,
]]
The test validator looks like:
<?php
//
$modx->log(modX::LOG_LEVEL_ERROR,'starting snippet');
$modx->log(modX::LOG_LEVEL_ERROR,$param);
return false;
It does dump a couple log entries, but the form still validates! arg!
1. isn't register supposed to validate the form if I return true & fail validation if I return false?
2. are all the form fields available in the validator? I have several to pass in to make sure at least one was checked, i.e.
&validate=`extension:aiRequired=^box-a, box-b box-c, etc^,