adding a bit of javascript to submit the form when done is checked

This commit is contained in:
tim madden 2011-03-10 13:50:01 +08:00 committed by Reinier Balt
parent 5fdc5ae436
commit 23e04b7884
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@
</span>
<% this_year = current_user.time.to_date.strftime("%Y").to_i
if parent_container_type == 'show_mobile' -%>
<p><label for="todo_done"><%= t('todos.done') %></label>&nbsp;<%= check_box_tag("done", 1, @todo && @todo.completed?, "tabindex" => 1) %></p>
<p><label for="todo_done"><%= t('todos.done') %></label>&nbsp;<%= check_box_tag("done", 1, @todo && @todo.completed?, "tabindex" => 1, "onClick" => "document.mobileEdit.submit()") %></p>
<% end -%>
<h2><label for="todo_description"><%= t('common.description') %></label></h2>
<%= text_field( "todo", "description", "tabindex" => 2, "maxlength" => 100, "size" => 50) %>

View file

@ -1,4 +1,4 @@
<% form_tag todo_path(@todo, :format => 'm'), :method => :put do %>
<% form_tag todo_path(@todo, :format => 'm'), :name => 'mobileEdit', :method => :put do %>
<%= render :partial => 'edit_mobile', :locals => { :parent_container_type => "show_mobile" } %>
<p><input type="submit" value="<%= t('common.update') %>" tabindex="6" accesskey="#" /></p>
<% end -%>