I'm using the client_side_validation gem in my multi-model form. It's working fine, but I have one issue. The form has a save button, which should enable the user to save the form for later. When this button is clicked, nothing happens, I stay in the same page. I know I have validation messages, but the user should be able to complete them later.
How can I have a form button that works normally (calls the required action) while having client side validation.
Thank you.
This is my form if it will help..
<%= form_for @applicant, :validate => true do |f| %>
<div class="field">
<%= f.label :first_name, {:class => 'label'}%>
<%= f.text_field :first_name ,{:class => 'span3'}%>
</div>
<div class="field">
<%= f.label :middle_name, {:class => 'label'}%>
<%= f.text_field :middle_name,{:class => 'span3'}%>
</div>
<div class="actions" style="padding-left: 350px;">
<%= f.submit "Save", :name => "save", :class => 'btn'%>
<%= f.submit "Submit", :name => "submit", :class => 'btn' %>
</div>
So I would like to go to the create action when I click the save button, even if I have validation errors..
Thanks.