Field validation vs. Deletion
Field validation vs. Deletion
Hello there,
I just started using Editor , and I'm struggling with the field validation when deleting a row.
I.c.:
I added a field validation for a date field which is required when inserting new records
->validator( 'Validate::required', array( "message" => "Gelieve een begindatum op te geven" ) )
Nonetheless, my table contains certain records which are missing this field (old dirty data). When trying to remove these records through the datatables/editor, the delete fails (fieldErrors:[{name: "calendar_vrijstelling.dtm_vanaf", status: "Gelieve een begindatum op te geven"}]).
Question: Is it possible to circumvent/bypass field validation when deleting? Or is this not possible and should i start working with preSubmit validation?
Thnx alot for any advice,
Arthur
Answers
The individual field validation shouldn't run when deleting a row. I've just tried it locally and wasn't able to make that error happen.
Could you show me your full PHP file for the Editor configuration and also let me know what version of the PHP libraries you are using please?
Allan
Hi Allan,
thnx for the prompt reply.
Here you can see the php file for the editor (not the javascript/jquery stuff)
I'm using version @version 1.6.3 (tried to upgrade to 1.7.0 but received a bunch of errors concerning passwords and stuff, but don't have enough time for the moment to do the upgrade)
I've just had a look at the source for 1.6.3 and at the top of the
validate
function it has:Could you show me the data that is being submitted to the server when to trigger the delete action please? If you have a link to the page in question that would be even better.
Thanks,
Allan