Commit 73975421 authored by Ivan Tyagov's avatar Ivan Tyagov

Disable other form elements having same html tag and name attribut if elemet explicitly passed.

This way is some rare cases where in one form ERP5 page multiple such elements exists we can still send form with correct data.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36714 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 34962ce7
...@@ -174,7 +174,7 @@ function fixLeftRightHeightAndFocus(fix_height) {\n ...@@ -174,7 +174,7 @@ function fixLeftRightHeightAndFocus(fix_height) {\n
// and modify respective main form action\n // and modify respective main form action\n
// if clear_changed_flag is set to true, changed will be set to false, so no\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 // warning message about unsaved changes will be displayed\n
function submitFormOnEnter(event, form, method_name, clear_changed_flag){\n function submitFormOnEnter(event, form, method_name, clear_changed_flag, element){\n
if (clear_changed_flag == null){\n if (clear_changed_flag == null){\n
clear_changed_flag = false;\n clear_changed_flag = false;\n
}\n }\n
...@@ -186,6 +186,12 @@ function submitFormOnEnter(event, form, method_name, clear_changed_flag){\n ...@@ -186,6 +186,12 @@ function submitFormOnEnter(event, form, method_name, clear_changed_flag){\n
if (clear_changed_flag==true) {\n if (clear_changed_flag==true) {\n
changed = false;\n changed = false;\n
}\n }\n
if(element!=null){\n
// disable other form elements having same name attribute\n
forEach(getElementsByTagAndClassName(element.tagName), function (input){\n
if((input.name == element.name) && (input!=element)){input.disabled = true;}\n
});\n
}\n
form.submit();\n form.submit();\n
}\n }\n
}\n }\n
......
955 957
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment