Bug 17725: Same for textarea when cloning a field
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Jan 2017 20:06:09 +0000 (21:06 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jan 2017 11:26:34 +0000 (11:26 +0000)
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/js/cataloging.js

index 44cd949..59efd6c 100644 (file)
@@ -129,6 +129,12 @@ function CloneField(index, hideMarc, advancedMARCEditor) {
                     inputs[j].value = "";
                 }
             }
+            var textareas = divs[i].getElementsByTagName('textarea');
+            for( j = 0 ; j < textareas.length ; j++ ) {
+                if(textareas[j].getAttribute("id") && textareas[j].getAttribute("id").match(/^tag_/) ){
+                    textareas[j].value = "";
+                }
+            }
 
             inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
             inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);