# Remote function not submitting form

**URL:** <https://www.ruby-forum.com/t/remote-function-not-submitting-form/111029>\
**Category:** Rails\
**Created:** [August 2, 2007, 1:08am UTC](https://www.ruby-forum.com/t/remote-function-not-submitting-form/111029 "2007-08-02T01:08:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [August 2, 2007, 1:08am UTC](https://www.ruby-forum.com/t/remote-function-not-submitting-form/111029/1 "2007-08-02T01:08:37Z")

</div>

Hi all,

I have this code:

```
<%= collection_select('declarations_payers', 'user', @users, 'id',

```

‘fullname’, {},  
{:onChange =\> remote\_function(  
:update =\> “participants”,  
:url =\> { :controller =\> ‘ajax’,  
:action =\> ‘declaration\_users’ }  
)  
}  
) %\>

It’s inside a div, inside a form generated with form\_tag.

But when I change the item of the selectlist, it doesn’t submit the  
form data. Does anyone know what’s the problem?  
Or maybe how I can solve this problem. I tried the serialize()  
function, but that can only be used for one field.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [August 2, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/remote-function-not-submitting-form/111029/2 "2007-08-02T22:31:18Z")

</div>

Leon B. wrote:

> Hi all,
> 
> I have this code:
> 
> ```
> <%= collection_select('declarations_payers', 'user', @users, 'id',
> 
> ```
> 
> ‘fullname’, {},  
> {:onChange =\> remote\_function(  
> :update =\> “participants”,  
> :url =\> { :controller =\> ‘ajax’,  
> :action =\> ‘declaration\_users’ }  
> )  
> }  
> ) %\>
> 
> It’s inside a div, inside a form generated with form\_tag.
> 
> But when I change the item of the selectlist, it doesn’t submit the  
> form data. Does anyone know what’s the problem?  
> Or maybe how I can solve this problem. I tried the serialize()  
> function, but that can only be used for one field.
> 
> Thanks in advance!

I tried the :submit argument, but that requires the use of a form with  
an id.  
How can I used the default method form\_tag and add an :id to that? I  
can’t get that working.
