From 73b11609498534148dff8a750da1c1ff61d9c319 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Wed, 11 Jan 2017 21:06:09 +0100
Subject: [PATCH] Bug 17725: Same for textarea when cloning a field

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
---
 koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js
index 8930466..97325c0 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js
@@ -110,6 +110,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);
-- 
2.1.4