# Submit a form from RJS

**URL:** <https://www.ruby-forum.com/t/submit-a-form-from-rjs/103238>\
**Category:** Rails\
**Created:** [May 3, 2007, 9:33am UTC](https://www.ruby-forum.com/t/submit-a-form-from-rjs/103238 "2007-05-03T09:33:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [May 3, 2007, 9:33am UTC](https://www.ruby-forum.com/t/submit-a-form-from-rjs/103238/1 "2007-05-03T09:33:35Z")

</div>

I am submitting an Ajax form with form\_remote\_tag

in my view  
\<% form\_remote\_tag( :url =\>{:action =\> ‘list’}, :html =\> {:id =\>  
‘prop\_search\_form’, :name =\> “prop\_search\_form”} ) do %\>  
…  
\<% end %\>

## in my controller I test the request, to display a partial def list … if request.xhr? render :partial =\> ‘result\_area’, :layout =\> false end end

now on a specific condition, I need to modify some form values (hidden  
and radio), then I would like to submit the form… if a use page \<\<  
"$(‘prop\_search\_form’).submit(), I don’t have an ajax request … and if  
I try the following, I don’t catch the form parameters… what could  
be the solution ?

def show\_my\_posts  
render :update do |page|  
page \<\< “$(‘current\_user\_posts’).value = ‘1’”  
page \<\< “$(‘pt0’).checked = ‘true’”  
page.redirect\_to :action =\> ‘list’, :with =\>  
“Form.serialize(‘prop\_search\_form’)+’&=’”  
end  
end
