# How to hide a div section after pressing Submit button in a

**URL:** <https://www.ruby-forum.com/t/how-to-hide-a-div-section-after-pressing-submit-button-in-a/85870>\
**Category:** Rails\
**Created:** [February 17, 2007, 12:37am UTC](https://www.ruby-forum.com/t/how-to-hide-a-div-section-after-pressing-submit-button-in-a/85870 "2007-02-17T00:37:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [February 17, 2007, 12:37am UTC](https://www.ruby-forum.com/t/how-to-hide-a-div-section-after-pressing-submit-button-in-a/85870/1 "2007-02-17T00:37:27Z")

</div>

Hello,

```
 I'm having trouble with this, I have a form with form_remote_tag,

```

every thing works ok, the remote function is called, I can render some  
partial, etc, but I can’t hide the div that contains the form, Do I  
need RJS or can where can call some DOM instrucctions since the remote  
function?

Thank you.

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [February 17, 2007, 1:42am UTC](https://www.ruby-forum.com/t/how-to-hide-a-div-section-after-pressing-submit-button-in-a/85870/2 "2007-02-17T01:42:34Z")

</div>

Hi Mike,

I had this implementation problem many months ago and I ended up  
using an RJS file to dismiss the div/dialog. I found that trying to  
use the on complete callback didn’t work for me. I wrote up a blog  
entry about my experience of creating a modal dialog with a form  
submission here:

[http://javathehutt.blogspot.com/2006/07/rails-realities-part-15-ajax-](http://javathehutt.blogspot.com/2006/07/rails-realities-part-15-ajax-)  
modal.html

Hope that helps

-Michael  
[http://javathehutt.blogspot.com](http://javathehutt.blogspot.com)
