I have a form_tag with some mandatory fields as below
<% form_tag url do %>
<%= text_field_tag "user[name]", user[:name], :required => true %>
<%= submit_tag 'Continue', :class => 'submit_button' %>
<% end %>
When i submit the form with just this, it works fine by throwing errors saying that the field is mandatory. But when i bind the submit button with a click event, the required=> true doesnot work anymore. Eg.
$(".submit_button").bind("click",function(e){
e.preventDefault();
//Have some code here, I dont want to put field validations here
$("form").submit();
});
I dont want to put js validations for each and every field, so how can i make the default rails required attibute to work. Please suggest if am missing anything here