Saturday 15 June 2013

ruby on rails - Form_for each loop - position element submit outsite the loop -



ruby on rails - Form_for each loop - position element submit outsite the loop -

this mu form:

.col-lg-12.col-md-12.col-sm-12 .row.userinfo .col-lg-12 %h2.block-title-2 uw gegevens staan ​​hieronder vermeld. .w100.clearfix .col-xs-12.col-sm-6.col-md-4 .panel.panel-default .panel-heading %h3.panel-title vul uw gegevens in: .panel-body = form_for(@lead) |f| .col-xs-12.col-sm-12 .form-group.required = f.label :firstname %sup * = f.text_field :firstname, size: 100 , :placeholder => "voornaam", :class => "form-control" = f.submit "submit", :class => "btn btn-primary btn-small" %i.fa.fa-arrow-circle-right .cartfooter.w100 .pull-right %a.btn.btn-primary.btn-small{:href => "checkout-2.html"} gegevens juist ? - verzenden naar nice2stay   %i.fa.fa-arrow-circle-right

i want add together

= f.submit

in .cartfooter.w100 / pull-right element. f.submit element belongs form_for eah loop. how can that?

thanks..remco

a regular submit button needs within form element submit form, 1 solution place button (outside form) has javascript submits form, or clicks submit button (the latter improve if have other javascript happens on submit button click event).

<!-- anywhere on page --> <%= button_to_function "submit", "$('#your-form-id').submit();" %>

i'm assuming utilize jquery here. can utilize equivalent bit of javascript if you're not using jquery.

ruby-on-rails ruby-on-rails-4 haml

No comments:

Post a Comment