# Validation question

**URL:** <https://discourse.slimframework.com/t/validation-question/4930>\
**Category:** Questions\
**Created:** [August 22, 2021, 2:11pm UTC](https://discourse.slimframework.com/t/validation-question/4930 "2021-08-22T14:11:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![meazy](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@meazy](https://discourse.slimframework.com/u/meazy)\
**Post date:** [August 22, 2021, 2:11pm UTC](https://discourse.slimframework.com/t/validation-question/4930/1 "2021-08-22T14:11:18Z")

</div>

If I am using cakephp/validation and selective/validation. I am confused on what happens with the json response. I redirect to the page and then use js to put data back into the inputs?

---

<div class="post-metadata">

**Author:** ![odan](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@odan](https://discourse.slimframework.com/u/odan)\
**Post date:** [August 22, 2021, 8:10pm UTC](https://discourse.slimframework.com/t/validation-question/4930/2 "2021-08-22T20:10:50Z")

</div>

Hi @meazy

In a typical web application, the form data is sent to the server via Ajax and validated before processing.  
In case of a validation error (422) the server also returns further error details which can then be rendered in the GUI.

---

<div class="post-metadata">

**Author:** ![meazy](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@meazy](https://discourse.slimframework.com/u/meazy)\
**Post date:** [August 22, 2021, 10:39pm UTC](https://discourse.slimframework.com/t/validation-question/4930/3 "2021-08-22T22:39:58Z")

</div>

Ok. Great. I understand.
