diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml
index 0cc25a9ef82f6089000235bdc43c2694fbbd9107..d628033eee20fea695ac378e78367484fd6cd4d3 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml
@@ -182,14 +182,22 @@ function fixLeftRightHeightAndFocus(fix_height) {\n
   autoFocus();\n
 }\n
 \n
-// This function can be used to catch ENTER pressed in an input \n
+// This function can be used to catch ENTER pressed in an input\n
 // and modify respective main form action\n
-function submitFormOnEnter(event, form, method_name){\n
+// if clear_changed_flag is set to true, changed will be set to false, so no\n
+// warning message about unsaved changes will be displayed\n
+function submitFormOnEnter(event, form, method_name, clear_changed_flag){\n
+  if (clear_changed_flag == null){\n
+    clear_changed_flag = false;\n
+  }\n
   if(event.keyCode == 13){\n
     if (form == \'main_form\') {\n
       form = getElement(form); // backward compatibility\n
     }\n
     form.action = method_name;\n
+    if (clear_changed_flag==true) {\n
+      changed = false;\n
+    }\n
     form.submit();\n
   }\n
 }\n
@@ -252,7 +260,7 @@ This event handler set a dirty flag which cause a warning\n
 while leaving the page, unless leaving by:\n
     - saving (see clickSaveButton function from this file)\n
     - clicking a relation field wheel\n
-    - a dialog action\n
+    - clicking on a input with type submit\n
 */\n
 var addOnChangeEventHandler = function() {\n
   var master = document.getElementById("master");\n
@@ -266,9 +274,9 @@ var addOnChangeEventHandler = function() {\n
             nodes[j].nodeName == "SELECT" ||\n
             nodes[j].nodeName == "TEXTAREA") {\n
             if (nodes[j].value == "update..." ||\n
-                nodes[j].id == "__ac_name" ||\n
-                nodes[j].id == "password") {\n
-           // this is a relation field wheel\n
+                (nodes[j].nodeName == "INPUT" &&\n
+                nodes[j].type == \'submit\')) {\n
+             // this is a relation field wheel or a submit form button\n
            nodes[j].onclick = function() { changed = false;};\n
           } else {\n
             if (!nodes[j].onchange) {\n
@@ -278,7 +286,7 @@ var addOnChangeEventHandler = function() {\n
         }\n
       }\n
     }\n
-  } \n
+  }\n
 }\n
 \n
 addLoadEvent(addOnChangeEventHandler);\n
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
index 189296e610cbd13e6ca2c464aa3c00fc3717fb10..779a8736e2c9762c2e62590be40c16f5209c1589 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
@@ -1 +1 @@
-825
\ No newline at end of file
+826
\ No newline at end of file