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:
parent
628578cda5
commit
ffc8dbad8c
@ -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>
|
||||
|
@ -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">
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -2,8 +2,9 @@
|
||||
<h2><%= t ".heading_new_measurement" %></h2>
|
||||
|
||||
<%= labelled_form_for @measurement,
|
||||
url: project_measurements_path(@project),
|
||||
html: {id: 'measurement-form'} do |f| %>
|
||||
url: project_measurements_path(@project),
|
||||
html: {id: 'measurement-add-form', name: 'measurement-add-form'} do |f| %>
|
||||
|
||||
<%= error_messages_for @measurement %>
|
||||
|
||||
<div class="box tabular">
|
||||
|
@ -1,7 +1,9 @@
|
||||
<fieldset id="filters" class="collapsible">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
|
||||
<div>
|
||||
<%= 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 style="width:100%;">
|
||||
@ -9,16 +11,16 @@
|
||||
<td>
|
||||
<%= select_tag 'filters[domain]', domain_options_tag(session[:q_filters][:domain]),
|
||||
prompt: t('.domain_prompt'),
|
||||
onchange: '$("#filters_form").submit(); return false;' %>
|
||||
onchange: '$("#filters-form").submit();' %>
|
||||
</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>
|
||||
|
@ -1,11 +1,12 @@
|
||||
<%= error_messages_for @quantity %>
|
||||
|
||||
<div class="box tabular">
|
||||
<p><%= f.select :domain, domain_options, {required: true}, data: {
|
||||
remote: true,
|
||||
url: parents_project_quantities_path(@project),
|
||||
params: "form=#{f.options[:html][:id]}"
|
||||
} %></p>
|
||||
<p><%= f.select :domain, domain_options, {required: true},
|
||||
{autocomplete: 'off',
|
||||
data: {remote: true,
|
||||
url: parents_project_quantities_path(@project),
|
||||
params: "form=#{f.options[:html][:id]}"}}
|
||||
%></p>
|
||||
<p><%= f.select :parent_id, parent_options(@quantity.domain),
|
||||
{required: true, label: :field_parent_quantity, include_blank: t('.null_parent')} %></p>
|
||||
<p><%= f.text_field :name, size: 25, required: true %></p>
|
||||
|
@ -65,8 +65,10 @@
|
||||
<tr>
|
||||
<td class="form" colspan="6">
|
||||
<div id="edit-quantity">
|
||||
<%= labelled_form_for @quantity, url: quantity_path(@quantity), method: :patch,
|
||||
remote: true, html: {id: 'quantity-edit-form'} do |f| %>
|
||||
<%= labelled_form_for @quantity,
|
||||
url: quantity_path(@quantity),
|
||||
method: :patch, remote: true,
|
||||
html: {id: 'quantity-edit-form', name: 'quantity-edit-form'} do |f| %>
|
||||
|
||||
<%= render partial: 'quantities/form', locals: {f: f} %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
|
@ -13,8 +13,9 @@
|
||||
<h2><%= t ".heading_new_quantity" %></h2>
|
||||
|
||||
<%= labelled_form_for @quantity,
|
||||
url: project_quantities_path(@project),
|
||||
html: {id: 'quantity-add-form'} do |f| %>
|
||||
url: project_quantities_path(@project),
|
||||
html: {id: 'quantity-add-form', name: 'quantity-add-form'} do |f| %>
|
||||
|
||||
<%= render partial: 'quantities/form', locals: {f: f} %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= link_to l(:button_cancel), "#", onclick: '$("#add-quantity").hide(); return false;' %>
|
||||
|
@ -13,8 +13,9 @@
|
||||
<h2><%= t ".heading_new_source" %></h2>
|
||||
|
||||
<%= labelled_form_for @source,
|
||||
url: project_sources_path(@project),
|
||||
html: {id: 'source-form'} do |f| %>
|
||||
url: project_sources_path(@project),
|
||||
html: {id: 'source-add-form', name: 'source-add-form'} do |f| %>
|
||||
|
||||
<%= render partial: 'sources/form', locals: {f: f} %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= link_to l(:button_cancel), "#", onclick: '$("#add-source").hide(); return false;' %>
|
||||
|
@ -13,8 +13,9 @@
|
||||
<h2><%= t ".heading_new_unit" %></h2>
|
||||
|
||||
<%= labelled_form_for @unit,
|
||||
url: project_units_path(@project),
|
||||
html: {id: 'unit-form'} do |f| %>
|
||||
url: project_units_path(@project),
|
||||
html: {id: 'unit-add-form', name: 'unit-add-form'} do |f| %>
|
||||
|
||||
<%= render partial: 'units/form', locals: {f: f} %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= link_to l(:button_cancel), "#", onclick: '$("#add-unit").hide(); return false;' %>
|
||||
|
Reference in New Issue
Block a user