HI,
I am new to Datatables and have spent a couple of days trying to find the solution without making any head way. So please forgive me if this is a newbie question.
In the insert\edit function i have 2 fields that only appears when one specific value on other field is selected:
editor.dependent( 'p2b_users.naccessusers', function ( val ) {
return val === '1' ?
{ show: ['p2b_users.supervisor_id','p2b_users.sfid'] } :
{ hide: [] }; } );
I´m trying to use the required\notEmpty function, but if i use this way i'm not allowed to submit the form even without triggering the editor.dependent (show) event.
Field::inst( 'p2b_users.sfid' )
->validator( Validate::required() )
->validator( Validate::numeric() )
->validator( Validate::unique(ValidateOptions::inst()
->message('SFID já atribuído.')
))
Is it possible to use the required validator ONLY if those fields where visible triggered by the editor.dependent (show) event?
Can someone help me please?
Thank you very much.