Skip to content

Commit

Permalink
adding a bit of javascript to submit the form when done is checked
Browse files Browse the repository at this point in the history
  • Loading branch information
tim madden authored and lrbalt committed Mar 10, 2011
1 parent 5fdc5ae commit 23e04b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/todos/_edit_mobile.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -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) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/todos/show.m.erb
Original file line number Diff line number Diff line change
@@ -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 -%>
Expand Down

0 comments on commit 23e04b7

Please sign in to comment.