OnChange select

Hello

I would like to submit my form with a select

<% form_for :pay , @pay, :url => sort_pays_path, :html => { :method =>
:put } do |f| %>
<%= f.select :CodePays, @pays.collect {|c| [ c.LibelleFr, c.CodePays ]
}, { :selected => “FR” } %>
<%= f.select :zones , @france.zones.collect {|c| [ c.Libelle,
c.IDZoneGeographique ] } , {:onChange => ‘this.form.submit();’ }%>
<%= f.select :villes , @france.code_postaux.collect {|c| [ c.ville,
c.IDCodePostal ] } %>
<% end %>

Nothing is hapening

I don’t see nothing my html source

FRANCE AIN Aisne BOURG-EN-BRESSE Laon </form

Lil help thanks

On Dec 20, 2:22 pm, bolo [email protected] wrote:

<%= f.select :CodePays, @pays.collect {|c| [ c.LibelleFr, c.CodePays ]}, { :selected => “FR” } %> <%= f.select :zones , @france.zones.collect {|c| [ c.Libelle,
c.IDZoneGeographique ] } , {:onChange => ‘this.form.submit();’ }%>
<%= f.select :villes , @france.code_postaux.collect {|c| [ c.ville,
c.IDCodePostal ] } %>

Try using :onchange

:onChange != :onchange

Aaron

Hello arron

So i changer for
<%= f.select :zones , @pay.zones.collect {|c| [ c.Libelle,
c.IDZoneGeographique ] }, {:onchange => ‘this.form.submit();’ } %>

But Nothing and more i don’t see the code in my html view
AIN

Aisne

On Dec 21, 8:51 am, “Bolo” [email protected] wrote:

Hello arron

So i changer for
<%= f.select :zones , @pay.zones.collect {|c| [ c.Libelle,
c.IDZoneGeographique ] }, {:onchange => ‘this.form.submit();’ } %>

I think :onchange belongs in the html_options filed of the select call
instead of the options field. Try this:

<%= f.select :zones , @france.zones.collect {|c| [ c.Libelle,
c.IDZoneGeographique ] }, {}, {:onChange => ‘this.form.submit();’ }%>

Aaron

Thanks it’s working