Index: app/views/queries/_filters.rhtml =================================================================== --- app/views/queries/_filters.rhtml (revision 2087) +++ app/views/queries/_filters.rhtml (working copy) @@ -53,6 +53,21 @@ select.multiple = true; } } + +function textField_onKeyPress(evt, form) { + var keyCode = null; + + if( typeof evt.which != undefined ) { + keyCode = evt.which; + } else if( evt.keyCode ) { + keyCode = evt.keyCode; + } + if( 13 == keyCode && $('query_form') && $('content')) { + <%= remote_function(:url => { :set_filter => 1}, :update => "content", :with => "Form.serialize('query_form')") %> + return false; + } + return true; +} //]]> @@ -80,11 +95,11 @@ <%= link_to_function image_tag('bullet_toggle_plus.png'), "toggle_multi_select('#{field}');", :style => "vertical-align: bottom;" %> <% when :date, :date_past %> - <%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 3, :class => "select-small" %> <%= l(:label_day_plural) %> + <%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 3, :class => "select-small", :onkeypress => "return textField_onKeyPress(event, this.form);" %> <%= l(:label_day_plural) %> <% when :string, :text %> - <%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 30, :class => "select-small" %> + <%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 30, :class => "select-small", :onkeypress => "return textField_onKeyPress(event, this.form);" %> <% when :integer %> - <%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 3, :class => "select-small" %> + <%= text_field_tag "values[#{field}][]", query.values_for(field), :id => "values_#{field}", :size => 3, :class => "select-small", :onkeypress => "return textField_onKeyPress(event, this.form);" %> <% end %>