Skip to content
Advertisement

Tag: cakephp-4.x

Enabling null on many FKs to same associated table

I have multiple fields setup as FK to the same table. The FK can also be NULL. I keep getting this error: Database structure: Column definition (ie. late_agreement_exception_outcome_recommendation_id): Column relationship (ie. late_agreement_exception_outcome_recommendation_id): ExceptionTable: FK setup to ExceptionOutcomes Edited rules attempting to enable entry of a null value for the field value: Update #1 I changed the association name like so:

How to display validation errors in JSON of associated fields in Cakephp4?

I’m looking for a way to display validation errors in jQuery after sending a form in ajax that returns validation errors in JSON. My code works for simple form, but the difficulties appear for more complex forms, especially for forms containing inputs for associated data. For example : Here is a form containing input files and associated data for writing

ERROR: POST http://localhost:8765/users/delete/delete8 403 (Forbidden)

I’m using cakephp4. trying to add some sweetalert. Sweetalert is popping up when the delete button is clicked but when I click confirm for delete it’s not deleting the data. template/layout/Users/index.php template/layout/Users/index.php delete method is as follows in my UsersController.php UsersController.php Route File is here config/route.php }); Answer I am sure it’s the CSRF token. Try to replace with Also

CakePHP4 – Create Record with Ajax

I’m new working with CakePHP and I’m having a hell of a time trying to figure out how to add a form that can post to a different db table with ajax. Basically, I’ve got a form that carries out a search which works fine, but before the user carries out the search I need to capture his email &

Advertisement