1
0

Added form names and select tag autocomplete off

To make select tags show selected option (FF bug)
https://stackoverflow.com/questions/1479233/why-doesnt-firefox-show-the-correct-default-select-option
This commit is contained in:
cryptogopher
2019-11-28 01:26:43 +01:00
parent 628578cda5
commit ffc8dbad8c
11 changed files with 46 additions and 32 deletions

View File

@@ -3,33 +3,35 @@
<div>
<%= error_messages_for @formula_q %>
<%= form_tag url, id: 'filters_form', method: :get, remote: true do %>
<%= form_tag url, id: 'filters-form', name: 'filters-form',
method: :get, remote: true do %>
<table class="filter">
<tr>
<td>
<%= text_field_tag 'filters[name]', session[:i_filters][:name], placeholder: 'name',
onblur: '$("#filters_form").submit(); return false;' %>
onblur: '$("#filters-form").submit(); return false;' %>
</td>
<td>
<%= select_tag 'filters[visibility]',
visibility_options(session[:i_filters][:visibility]),
prompt: t('.visibility_prompt'),
onchange: '$("#filters_form").submit(); return false;' %>
onchange: '$("#filters-form").submit();' %>
</td>
<td style="width:100%;">
<%= text_field_tag 'filters[nutrients]', session[:i_filters][:nutrients],
placeholder: 'conditional expression including nutrients', size: 40,
style: 'box-sizing:border-box; width:100%;',
onblur: '$("#filters_form").submit(); return false;' %>
onblur: '$("#filters-form").submit(); return false;' %>
</td>
<td>
<%= link_to l(:button_apply), '#', class: "icon icon-checked",
onclick: '$("#filters_form").submit(); return false;' %>
onclick: '$("#filters-form").submit(); return false;' %>
</td>
<td>
<%= link_to l(:button_clear), '#', class: "icon icon-reload",
onclick: '$("#filters_form input, #filters_form select").val("");
$("#filters_form").submit(); return false;' %>
onclick: '$("#filters-form input, #filters-form select").val("");
$("#filters-form").submit(); return false;' %>
</td>
</tr>
</table>

View File

@@ -2,8 +2,9 @@
<h2><%= t ".heading_new_ingredient" %></h2>
<%= labelled_form_for @ingredient,
url: project_ingredients_path(@project),
html: {id: 'ingredient-form'} do |f| %>
url: project_ingredients_path(@project),
html: {id: 'ingredient-add-form', name: 'ingredient-add-form'} do |f| %>
<%= error_messages_for @ingredient %>
<div class="box tabular">

View File

@@ -2,8 +2,8 @@
<h2><%= t ".heading_import_ingredients" %></h2>
<%= form_tag import_project_ingredients_path(@project),
multipart: true,
id: 'import-form' do %>
id: 'import-form', name: 'import-form', multipart: true do %>
<div class="box tabular">
<p>
<label><%= t ".label_import_select_csv_file" %></label>

View File

@@ -2,7 +2,9 @@
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
<div>
<%= form_tag toggle_nutrient_column_project_ingredients_path(@project),
id: 'add_nutrient_column', method: :post, remote: true do %>
id: 'nutrient-column-add-form', name: 'nutrient-column-add-form',
method: :post, remote: true do %>
<table>
<tr>
<td style="width:100%"></td>