Mulitple submit button in a form

0 views
Skip to first unread message

Greg Ma

unread,
Jul 28, 2010, 9:10:46 AM7/28/10
to rubyonra...@googlegroups.com
Hi,
I've trying to find during hours why the params name of the buttons are
in my parameters...
I would like to know why submit button was clicked. I taught the name of
the submit button was in the parameters but it"s not.
Someone has an idea why?

<% form_for @image, :url => eval(@assist_uri), :html => { :id =>
:frmCropAssist, :class => :regular } do %>
<p class="submit">
<%= hidden_field_tag :crop, '', :id => :hidCrop %>
<%= submit_tag 'Recadrer', :tabindex => 1, :accesskey => 'R', :id =>
:btnCrop, :class => :ok, :disabled => true, :confirm => 'Recadrer cette
image ? (Cette opération est définitive)', :name => :resize %>
<%= submit_tag 'Marge', :tabindex => 2, :accesskey => 'P', :id =>
:btnExpand, :class => :padder, :disabled => true,
:confirm => 'Extand cette image ? (Cette opération est définitive)',
:name => :expand %>
</p>
<% end %>


Greg
--
Posted via http://www.ruby-forum.com/.

Colin Law

unread,
Jul 28, 2010, 3:04:02 PM7/28/10
to rubyonra...@googlegroups.com
On 28 July 2010 14:10, Greg Ma <li...@ruby-forum.com> wrote:
> Hi,
> I've trying to find during hours why the params name of the buttons are
> in my parameters...
> I would like to know why submit button was clicked. I taught the name of
> the submit button was in the parameters but it"s not.
> Someone has an idea why?

It should be there as params[:commit]. If it is not then check that
the html of your page is valid by copying it from the browser (View,
Page source or similar) and pasting it into the w3c html validator.
If it is ok then have a look at the html for the button and see what
is wrong. Finally try removing all the extra options you have on the
submit_tag to see if one of them is interfering.

Colin

>
> <% form_for @image, :url => eval(@assist_uri), :html => { :id =>
> :frmCropAssist, :class => :regular } do %>
>  <p class="submit">
>    <%= hidden_field_tag :crop, '', :id => :hidCrop %>
>    <%= submit_tag 'Recadrer', :tabindex => 1, :accesskey => 'R', :id =>
> :btnCrop, :class => :ok, :disabled => true, :confirm => 'Recadrer cette
> image ? (Cette opération est définitive)', :name => :resize %>
>    <%= submit_tag 'Marge', :tabindex => 2, :accesskey => 'P', :id =>
> :btnExpand, :class => :padder, :disabled => true,
>    :confirm => 'Extand cette image ? (Cette opération est définitive)',
> :name => :expand %>
>  </p>
> <% end %>
>
>
> Greg
> --
> Posted via http://www.ruby-forum.com/.
>

> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages