diff --git a/product/ERP5Form/dtml/proxyFieldEdit.dtml b/product/ERP5Form/dtml/proxyFieldEdit.dtml index 9c9e015b36682b8596798feb6d7b4b351fd90165..9f1b5680bd69909210c5c46647e95a4c2f26c00f 100644 --- a/product/ERP5Form/dtml/proxyFieldEdit.dtml +++ b/product/ERP5Form/dtml/proxyFieldEdit.dtml @@ -155,13 +155,19 @@ function GetElementsWithClassName(elementName,className) { } return elemColl; } +function normalEvent() { return true; } +function ignoreEvent() { return false; } + var class_deletaged_list = GetElementsWithClassName('td','delegated'); for(var i=0; i<class_deletaged_list.length; i++) { element = class_deletaged_list[i].childNodes[1]; if (element.type == 'hidden'){ - element = class_deletaged_list[i].childNodes[2]; + element = element.nextSibling; } element.readOnly = true; + if (element.type == 'checkbox'){ + element.onclick = ignoreEvent; + } } function toggleFieldState(evt) { @@ -173,13 +179,19 @@ function toggleFieldState(evt) { if (isClass(allElements[i], 'to_disable')) { field = allElements[i].childNodes[1]; if (field.type == 'hidden'){ - field = allElements[i].childNodes[2]; + field = field.nextSibling; } if (field.readOnly){ field.readOnly = false; + if (field.type == 'checkbox'){ + field.onclick = normalEvent; + } } else{ field.readOnly = true; + if (field.type == 'checkbox'){ + field.onclick = ignoreEvent; + } } } } diff --git a/product/ERP5Form/dtml/proxyFieldTales.dtml b/product/ERP5Form/dtml/proxyFieldTales.dtml index 4577725f4c2773c5296b31075bf3c1c3449a0e4d..63d443c24ef7b14420049e79fd17ac99b12e1174 100644 --- a/product/ERP5Form/dtml/proxyFieldTales.dtml +++ b/product/ERP5Form/dtml/proxyFieldTales.dtml @@ -155,13 +155,19 @@ function GetElementsWithClassName(elementName,className) { } return elemColl; } +function normalEvent() { return true; } +function ignoreEvent() { return false; } + var class_deletaged_list = GetElementsWithClassName('td','delegated'); for(var i=0; i<class_deletaged_list.length; i++) { element = class_deletaged_list[i].childNodes[1]; if (element.type == 'hidden'){ - element = class_deletaged_list[i].childNodes[2]; + element = element.nextSibling; } element.readOnly = true; + if (element.type == 'checkbox'){ + element.onclick = ignoreEvent; + } } function toggleFieldState(evt) { @@ -173,13 +179,19 @@ function toggleFieldState(evt) { if (isClass(allElements[i], 'to_disable')) { field = allElements[i].childNodes[1]; if (field.type == 'hidden'){ - field = allElements[i].childNodes[2]; + field = field.nextSibling; } if (field.readOnly){ field.readOnly = false; + if (field.type == 'checkbox'){ + field.onclick = normalEvent; + } } else{ field.readOnly = true; + if (field.type == 'checkbox'){ + field.onclick = ignoreEvent; + } } } }