Permalink
Browse files

Change buttons to not be submit buttons

button elements are of type "submit" by default, so will submit the form if the
click handler doesn't prevent it. This can happen if there is a JS error in the
click handler (and be difficult to debug).
  • Loading branch information...
1 parent d5fc8bc commit 2742c77275bd09d00d3a010abf37c9bb57977a72 @jamiecobbett jamiecobbett committed Jan 29, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 app/views/artefacts/_artefact_section.html.erb
  2. +1 −1 app/views/artefacts/_form.html.erb
@@ -1,4 +1,4 @@
<div class="row-fluid artefact-section">
<%= select_tag("artefact[sections][]", options_from_collection_for_select(tag_collection, :tag_id, :unique_title, section_id), {:prompt => "Select a section", :class => "span4"}) %>
- <button class="btn btn-danger remove-section offset1">Remove this section</button>
+ <button class="btn btn-danger remove-section offset1" type="button">Remove this section</button>
</div>
@@ -50,7 +50,7 @@
<%= render :partial => 'artefact_section', :locals => {:section_id => nil, :tag_collection => tag_collection} %>
<% end %>
- <button id="add-section" class="btn btn-success">Add another section</button>
+ <button id="add-section" class="btn btn-success" type="button">Add another section</button>
<% end %>
<hr>

0 comments on commit 2742c77

Please sign in to comment.