# Remote\_form\_for validation

**URL:** <https://www.ruby-forum.com/t/remote-form-for-validation/89391>\
**Category:** Rails\
**Created:** [March 20, 2007, 2:36am UTC](https://www.ruby-forum.com/t/remote-form-for-validation/89391 "2007-03-20T02:36:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [March 20, 2007, 2:36am UTC](https://www.ruby-forum.com/t/remote-form-for-validation/89391/1 "2007-03-20T02:36:35Z")

</div>

If I’m using remote\_form\_for, how would I get the model validations to  
render just like on a non-ajax form?

---

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [March 20, 2007, 10:52am UTC](https://www.ruby-forum.com/t/remote-form-for-validation/89391/2 "2007-03-20T10:52:27Z")

</div>

On Mar 20, 2007, at 2:36 AM, jko170 wrote:

> If I’m using remote\_form\_for, how would I get the model validations to  
> render just like on a non-ajax form?

This is a possible pattern: In the view you have a DIV for errors,  
originally empty, and perhaps factored out to a partial ready for RJS  
“reloading”.

When the form is submitted there’s a RJS response that updates that  
DIV if @model.errors.empty? \> 0, or else follows your regular  
application flow, for example it redirects to a show action with  
page.redirect\_to.

– fxn

---

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [March 22, 2007, 2:41pm UTC](https://www.ruby-forum.com/t/remote-form-for-validation/89391/3 "2007-03-22T14:41:32Z")

</div>

Thank you!
