From 265d8ce9d224caefa62c1fb91aabcc459d456742 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 26 Oct 2020 17:22:08 +0000 Subject: [PATCH] [FIX] website_form: fix form values reset on Firefox Reseting the field should just be done through the form element's reset method to let the browser do it properly, otherwise the browser may validate the applied values (and for example mark the required field as wrong (making them red)). task-2312878 closes odoo/odoo#61200 X-original-commit: 7676fc069d8b6458d0fc1f8eafe087ce553743f0 Signed-off-by: Quentin Smetz (qsm) --- addons/website_form/static/src/snippets/s_website_form/000.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_form/static/src/snippets/s_website_form/000.js b/addons/website_form/static/src/snippets/s_website_form/000.js index 3b03fa390d5..fa0c920a53d 100644 --- a/addons/website_form/static/src/snippets/s_website_form/000.js +++ b/addons/website_form/static/src/snippets/s_website_form/000.js @@ -82,7 +82,7 @@ odoo.define('website_form.s_website_form', function (require) { this.$target.find('button').off('click'); // Empty imputs - this.$target.find('input[type="text"], input[type="email"], input[type="number"], input[type="tel"], input[type="url"], textarea').val(''); + this.$target[0].reset(); // Remove saving of the error colors this.$target.find('.o_has_error').removeClass('o_has_error').find('.form-control, .custom-select').removeClass('is-invalid');