Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 405313d5

Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt

  • ID 405313d551dc6e398887716a2889f19d51f0375b
  • Vorgänger 59adfa36
  • Nachfolger 28633ebf

jQuery-resetForm() anstelle von selbst geschriebenem Reset-Code nutzen

Unsere bisherigen Reset-Implementationen haben die Inputs alle auf leer
gesetzt. Die Standard-Reset-Routinen der Browser setzen die Inputs
allerdings auf ihren Zustand zurück, den sie beim Laden hatten, was auch
mehr Sinn ergibt.

Unterschiede anzeigen:

templates/webpages/background_job_history/_filter.html
[%- USE L %][%- USE LxERP %][%- USE HTML %]
<form action="controller.pl" method="post">
<form action="controller.pl" method="post" id="filter_form">
<div class="filter_toggle">
<a href="#" onClick="javascript:$('.filter_toggle').toggle()">[% LxERP.t8('Show Filter') %]</a>
[% IF SELF.filter_summary %]([% LxERP.t8("Current filter") %]: [% SELF.filter_summary %])[% END %]
......
[% L.hidden_tag('page', FORM.page) %]
[% L.submit_tag('action_list', LxERP.t8('Continue'))%]
<a href="#" onClick="javascript:$('#filter_table input,#filter_table select').val('');">[% LxERP.t8('Reset') %]</a>
[% L.button_tag("\$('#filter_form').resetForm();", LxERP.t8('Reset')) %]
</div>
templates/webpages/bank_transactions/_filter.html
[%- USE L %]
[%- USE LxERP %]
[%- USE HTML %]
<form action='controller.pl' method='post'>
<form action='controller.pl' method='post' id='filter_form'>
<div class='filter_toggle'>
<a href='#' onClick='javascript:$(".filter_toggle").toggle()'>[% 'Show Filter' | $T8 %]</a>
[% SELF.filter_summary | html %]
......
[% L.input_tag('action_list_all', LxERP.t8('Continue'), type = 'submit', class='submit')%]
<a href='#' onClick='javascript:$("#filter_table input").val("");$("#filter_table input[type=checkbox]").prop("checked", 0);'>[% 'Reset' | $T8 %]</a>
[% L.button_tag('$("#filter_form").resetForm()', LxERP.t8('Reset')) %]
</div>
</form>
templates/webpages/bank_transactions/assign_invoice.html
[% SET debug = 0 %]
<form method="post" action="javascript:filter_invoices();">
<form method="post" action="javascript:filter_invoices();" id="assign_invoice_window_form">
<b>[%- LxERP.t8("Bank transaction") %]:</b>
<table>
<tr class="listheading">
......
<p>
[% L.submit_tag('', LxERP.t8("Search")) %]
[% L.button_tag('add_selected_invoices()', LxERP.t8("Add invoices"), id='add_selected_record_links_button') %]
<a href="#" onclick="assign_invoice_reset_form();">[%- LxERP.t8("Reset") %]</a>
[% L.button_tag('$("#assign_invoice_window_form").resetForm()', LxERP.t8('Reset')) %]
<a href="#" onclick="$('#assign_invoice_window').dialog('close');">[% LxERP.t8("Cancel") %]</a>
</p>
......
});
}
function assign_invoice_reset_form() {
$('#assign_invoice_window form input[type=text]').val('');
}
$(function() {
$('#invnumber').focus();
});
//-->
</script>
templates/webpages/delivery_plan/_filter.html
[% L.hidden_tag('mode', SELF.mode) %]
[% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%]
<a href='#' onClick='javascript:$("#filter_table input").val("");$("#filter_table input[type=checkbox]").prop("checked", 0);$("#filter_table select").prop("selectedIndex", 0);'>[% 'Reset' | $T8 %]</a>
[% L.button_tag('$("#filter_form").resetForm()', LxERP.t8('Reset')) %]
</div>
</form>
templates/webpages/delivery_value_report/_filter.html
[%- USE L %]
[%- USE LxERP %]
[%- USE HTML %]
<form action='controller.pl' method='post'>
<form action='controller.pl' method='post' id='filter_form'>
<div class='filter_toggle'>
<a href='#' onClick='javascript:$(".filter_toggle").toggle()'>[% 'Show Filter' | $T8 %]</a>
[% SELF.filter_summary | html %]
......
[% L.hidden_tag('page', FORM.page) %]
[% L.hidden_tag('vc', SELF.vc) %]
[% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%]
<a href='#' onClick='javascript:$("#filter_table input").val("");$("#filter_table input[type=checkbox]").prop("checked", 0);$("#filter_table select").prop("selectedIndex", 0);'>[% 'Reset' | $T8 %]</a>
[% L.button_tag('$("#filter_form").resetForm()', LxERP.t8('Reset')) %]
</div>
</form>
templates/webpages/email_journal/_filter.html
[%- USE L %][%- USE LxERP %][%- USE HTML %]
<form action="controller.pl" method="post">
<form action="controller.pl" method="post" id="filter_form">
<div class="filter_toggle">
<a href="#" onClick="javascript:$('.filter_toggle').toggle()">[% LxERP.t8('Show Filter') %]</a>
[% IF SELF.filter_summary %]([% LxERP.t8("Current filter") %]: [% SELF.filter_summary %])[% END %]
......
[% L.hidden_tag("page", FORM.page) %]
[% L.submit_tag("action_list", LxERP.t8("Continue"))%]
<a href="#" onClick="javascript:$('#filter_table input,#filter_table select').val("");">[% LxERP.t8("Reset") %]</a>
[% L.button_tag('$("#filter_form").resetForm()', LxERP.t8('Reset')) %]
</div>
templates/webpages/financial_controlling_report/_filter.html
[%- USE LxERP %]
[%- USE HTML %]
[%- SET style='width: 400px' %]
<form action='controller.pl' method='post'>
<form action='controller.pl' method='post' id='filter_form'>
<div class='filter_toggle'>
<a href='#' onClick='javascript:$(".filter_toggle").toggle()'>[% 'Show Filter' | $T8 %]</a>
[% SELF.filter_summary %]
......
[% L.hidden_tag('sort_dir', FORM.sort_dir) %]
[% L.hidden_tag('page', FORM.page) %]
[% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%]
<a href='#' onClick='javascript:$("#filter_table input").val("");$("#filter_table option").prop("selected",0)'>[% 'Reset' | $T8 %]</a>
[% L.button_tag('$("#filter_form").resetForm()', LxERP.t8('Reset')) %]
</div>
templates/webpages/order/tabs/_multi_items_dialog.html
</table>
[% L.button_tag('update_result()', LxERP.t8('Filter')) %]
<a href='#' onClick='javascript:$("#multi_items_filter_table input").val("");$("#multi_items_filter_table input[type=checkbox]").prop("checked", 0);$("#multi_items_filter_table select").prop("selectedIndex", 0);'>[% 'Reset' | $T8 %]</a>
[% L.button_tag('$("#multi_items_form").resetForm()', LxERP.t8('Reset')) %]
<hr>
<div id='multi_items_result'></div>
templates/webpages/part/_multi_items_dialog.html
</table>
[% L.button_tag('update_result()', LxERP.t8('Filter')) %]
<a href='#' onClick='javascript:$("#multi_items_filter_table input").val("");$("#multi_items_filter_table input[type=checkbox]").prop("checked", 0);$("#multi_items_filter_table select").prop("selectedIndex", 0);'>[% 'Reset' | $T8 %]</a>
[% L.button_tag('$("#multi_items_form").resetForm()', LxERP.t8('Reset')) %]
<hr>
<div id='multi_items_result'></div>
templates/webpages/project/_filter.html
</td>
</tr>
</table>
[% L.button_tag('$("#search_form").resetForm()', LxERP.t8('Reset')) %]
templates/webpages/project/search.html
[%- INCLUDE 'common/flash.html' %]
<form method="post" action="controller.pl">
<form method="post" action="controller.pl" id="search_form">
<p>
[%- INCLUDE 'project/_filter.html' %]
templates/webpages/record_links/add_filter.html
<h1>[%- LxERP.t8("Add link: select records to link with") %]</h1>
<form method="post" action="controller.pl">
<form method="post" action="controller.pl" id="record_links_add_filter_form">
[% L.hidden_tag('object_model', SELF.object_model) %]
[% L.hidden_tag('object_id', SELF.object_id) %]
......
<p>
[% L.button_tag('filter_record_links()', LxERP.t8("Search")) %]
[% L.button_tag('add_selected_record_links()', LxERP.t8("Add links"), id='add_selected_record_links_button', disabled=1) %]
<a href="#" onclick="record_links_reset_form();">[%- LxERP.t8("Reset") %]</a>
[% L.button_tag('$("#record_links_add_filter_form").resetForm()', LxERP.t8('Reset')) %]
<a href="#" onclick="$('#record_links_add').dialog('close');">[% LxERP.t8("Cancel") %]</a>
</p>
......
record_links_change_form_to_match_type();
});
function record_links_reset_form() {
$('#record_links_add form input[type=text]').val('');
$('#record_links_add form select').prop('selectedIndex', 0);
}
function filter_record_links() {
var url="controller.pl?action=RecordLinks/ajax_add_list&" + $("#record_links_add form").serialize();
$.ajax({

Auch abrufbar als: Unified diff