Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

Standalone Bubble editing - On submitting edit, PHP code is running custom validator on other field

$
0
0

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);
            }),

Viewing all articles
Browse latest Browse all 81728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>