I am using the editor in standalone mode.
Everything works ok, but when I include a custom validator in any field as below, on submission the validator always seem to be run for that field even though I am editing a different field.
Field::inst( 'grid' )
->validator( Validate::notEmpty() )
->validator( function ( $val, $data, $field, $host ) {
return (validate_locator( $val )) ? true : 'Enter a 6 digit grid square. No hyphens. E.G QF56IF. 6 characters max';
})
->setFormatter( function ( $val, $data ) {
return strtoupper($val);
}),