# How to show form validation errors in specific view template other than the conventional one

**URL:** <https://discourse.cakephp.org/t/how-to-show-form-validation-errors-in-specific-view-template-other-than-the-conventional-one/11653>\
**Category:** Uncategorized\
**Created:** [November 9, 2023, 2:01pm UTC](https://discourse.cakephp.org/t/how-to-show-form-validation-errors-in-specific-view-template-other-than-the-conventional-one/11653 "2023-11-09T14:01:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lamine](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@Lamine](https://discourse.cakephp.org/u/Lamine)\
**Post date:** [November 9, 2023, 2:01pm UTC](https://discourse.cakephp.org/t/how-to-show-form-validation-errors-in-specific-view-template-other-than-the-conventional-one/11653/1 "2023-11-09T14:01:30Z")

</div>

Hello everyone.  
My code doesn’t have a separated view template for edit action, instead the edit form resides inside a div acting as bootstrap modal in view template.

The problem is that, upon submit if the form has validation errors, I want to show the errors in the same page instead of having CakePHP trying to render conventional view template to show the errors there.

 ![Screenshot (74)](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/2/231821cd46c8698aa659d191bf01ccee86c3d1db.png)  
 ![Screenshot (75)](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/d/d75f109e643077f0dc68306137d1818647b08035.png)

---

<div class="post-metadata">

**Author:** ![jarekgol](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jarekgol](https://discourse.cakephp.org/u/jarekgol)\
**Post date:** [November 14, 2023, 11:20am UTC](https://discourse.cakephp.org/t/how-to-show-form-validation-errors-in-specific-view-template-other-than-the-conventional-one/11653/2 "2023-11-14T11:20:14Z")

</div>

I am afraid that you must do it manually. In normal workflow, errors are rendered in input’s divs generated by php at server site.  
So if you want using js form, you must send data to controller and then catch response via XMLHttp or similar. In entity you have error field and if you find something there you must render this errors.

Maybe there is some add-ons but I don’t know them.

---

<div class="post-metadata">

**Author:** ![Lamine](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@Lamine](https://discourse.cakephp.org/u/Lamine)\
**Post date:** [November 15, 2023, 8:18am UTC](https://discourse.cakephp.org/t/how-to-show-form-validation-errors-in-specific-view-template-other-than-the-conventional-one/11653/3 "2023-11-15T08:18:53Z")

</div>

Yeah sure, I used fetch api to handle the task. Thank you
