Index: lib/style/common/templates/entryForm.tmpl
===================================================================
--- lib/style/common/templates/entryForm.tmpl	(revision 2026)
+++ lib/style/common/templates/entryForm.tmpl	(revision 2027)
@@ -46,6 +46,86 @@
 
         return newField;
     }
+
+    function addKeyword() {
+        var keyCountField = document.getElementById("keyCount");
+        var keyCount = keyCountField.getAttribute("value");
+        keyCount++;
+        keyCountField.setAttribute("value", keyCount);
+        var keyRow = createKeywordRow(keyCount);
+        var keyRowMarker = document.getElementById("addkeyrow");
+        var parent = keyRowMarker.parentNode;
+        parent.insertBefore(keyRow, keyRowMarker);
+    }
+
+    function createKeywordRow(keyCount) {
+        var nameField=createTextField("keyword" + keyCount, "40");
+        var nameCell = document.createElement("td");
+        nameCell.appendChild(nameField);
+
+        var keyTypeField=createKeyTypeSelect("kwType" + keyCount);
+        var keyTypeCell = document.createElement("td");
+        keyTypeCell.appendChild(keyTypeField);
+
+        var keyThField=createKeyThSelect("kwTh" + keyCount);
+        var keyThCell = document.createElement("td");
+        keyThCell.appendChild(keyThField); 
+
+        var keyRow = document.createElement("tr");
+        keyRow.appendChild(nameCell);
+        keyRow.appendChild(keyTypeCell);
+        keyRow.appendChild(keyThCell);
+
+        return keyRow;
+    }
+
+    function createKeyTypeSelect(name) {
+        var newField=document.createElement("select");
+        newField.setAttribute("name", name);
+	var option1=document.createElement("option");
+	var text1=document.createTextNode("none");
+	option1.appendChild(text1);
+	newField.appendChild(option1);
+	var option2=document.createElement("option");
+	var text2=document.createTextNode("theme");
+	option1.appendChild(text2);
+	newField.appendChild(option2);
+	var option3=document.createElement("option");
+	var text3=document.createTextNode("place");
+	option1.appendChild(text3);
+	newField.appendChild(option3)
+	var option4=document.createElement("option");
+	var text4=document.createTextNode("stratum");
+	option1.appendChild(text4);
+	newField.appendChild(option4);
+	var option5=document.createElement("option");
+	var text5=document.createTextNode("temporal");
+	option1.appendChild(text5);
+	newField.appendChild(option5);
+	var option6=document.createElement("option");
+	var text6=document.createTextNode("taxonomic");
+	option1.appendChild(text6);
+	newField.appendChild(option6);
+
+	return newField;
+    }
+
+    function createKeyThSelect(name) {
+        var newField=document.createElement("select");
+        newField.setAttribute("name", name);
+	var option1=document.createElement("option");
+	var text1=document.createTextNode("none");
+	option1.appendChild(text1);
+	newField.appendChild(option1);
+	var option2=document.createElement("option");
+	var text2=document.createTextNode("GCMD");
+	option2.appendChild(text2);
+	newField.appendChild(option2);
+
+	return newField;
+    }
+
+
   </script>
 
 [% IF cfg == 'nrs' %]
@@ -580,7 +660,15 @@
     </b>(for example keywords, have a look at the keyword thesaurus for the <a href=
 "http://gcmd.nasa.gov/Resources/valids/gcmd_parameters.html" target="nasa"><font color=
 "008000">NASA Global Change Master Directory (GCMD))</font></a></font></p>
+ [% numKey = 1 %]
+ [% IF keyCount > 0 %]
+   [% numKey = keyCount %]
+ [% END %]
+ <input type="hidden" name="keyCount" value="[%numKey%]" 
+            id="keyCount">
   <table cellspacing="0" border="0" cellpadding="9" width="760"
+bgcolor="#c6d6e7"> 
+ <table cellspacing="0" border="0" cellpadding="9" width="760"
 bgcolor="#c6d6e7">
     <tr> 
       <td width="34%" valign="TOP"> 
@@ -593,17 +681,19 @@
         <p><font size="-1"><b>Keyword Thesaurus</b></font></p>
       </td>
     </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword0" value="[%keyword0%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType0">
+        [% cnt = 1 %]
+        [% WHILE cnt <= numKey %]
+            <tr> 
+            <td>
+            [% SET key = "keyword${cnt}" %]
+            <input name="keyword[%cnt%]" value="[%$key%]" size="40">
+            </td>
+
+            <td>
+            [% SET keyT = "kwType${cnt}" %]
+            <select name="kwType[%cnt%]">
 	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType0%]</option>
+	     	<option selected>[%$keyT%]</option>
 	    [% END %]
 	    <option>none</option>
             <option>theme</option>
@@ -611,318 +701,28 @@
             <option>stratum</option>
             <option>temporal</option>
             <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh0">
+            </select>
+            </td>
+
+            <td>
+            [% SET keyTh = "kwTh${cnt}" %]
+            <select name="kwTh[%cnt%]">
 	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh0%]</option>
+	     	<option selected>[%$keyTh%]</option>
 	    [% END %]
 	    <option>none</option>
             <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword1" value="[%keyword1%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType1">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType1%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>theme</option>
-            <option>place</option>
-            <option>stratum</option>
-            <option>temporal</option>
-            <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh1">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh1%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword2" value="[%keyword2%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType2">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType2%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>theme</option>
-            <option>place</option>
-            <option>stratum</option>
-            <option>temporal</option>
-            <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh2">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh2%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword3" value="[%keyword3%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType3">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType3%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>theme</option>
-            <option>place</option>
-            <option>stratum</option>
-            <option>temporal</option>
-            <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh3">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh3%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword4" value="[%keyword4%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType4">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType4%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>theme</option>
-            <option>place</option>
-            <option>stratum</option>
-            <option>temporal</option>
-            <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh4">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh4%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword5" value="[%keyword5%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType5">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType5%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>theme</option>
-            <option>place</option>
-            <option>stratum</option>
-            <option>temporal</option>
-            <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh5">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh5%]</option>
-	    [% END %]
- 	    <option>none</option>
-            <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword6" value="[%keyword6%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType6">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType6%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>theme</option>
-            <option>place</option>
-            <option>stratum</option>
-            <option>temporal</option>
-            <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh6">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh6%]</option>
-	    [% END %]
-            <option>none</option>	
-            <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword7" value="[%keyword7%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType7">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType7%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>theme</option>
-            <option>place</option>
-            <option>stratum</option>
-            <option>temporal</option>
-            <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh7">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh7%]</option>
-	    [% END %]
-            <option>none</option>
-            <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword8" value="[%keyword8%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType8">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType8%]</option>
-	    [% END %]
-	    <option>none</option>
-            <option>theme</option>
-            <option>place</option>
-            <option>stratum</option>
-            <option>temporal</option>
-            <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh8">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh8%]</option>
-	    [% END %]
-            <option>none</option>
-            <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
-    <tr> 
-      <td width="34%" valign="TOP"> 
-        <p><font size="-1"> 
-          <input type="TEXT" name="keyword9" value="[%keyword9%]" size="40">
-          </font></p>
-      </td>
-      <td width="18%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwType9">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwType9%]</option>
-	    [% END %]
- 	    <option>none</option>
-            <option>theme</option>
-            <option>place</option>
-            <option>stratum</option>
-            <option>temporal</option>
-            <option>taxonomic</option>
-          </select>
-          </font></p>
-      </td>
-      <td width="48%" valign="TOP"> 
-        <p> <font size="-1">
-          <select name="kwTh9">
-	    [% IF form == 're_entry' %]
-	     	<option selected>[%kwTh9%]</option>
-	    [% END %]    
-            <option>none</option>
-            <option>GCMD</option>
-          </select>
-          </font></p>
-      </td>
-    </tr>
+            </select>
+            </td>
+            </tr>
+            [% cnt = cnt + 1 %]
+         [% END %]
+        <tr id="addkeyrow"> 
+            <td>
+                <input type="button" value="Add Keyword" id="addkeybutton1"
+                    onClick="addKeyword()">
+            </td>
+        </tr>
   </table>
   <br>
   <p align="left"><font size="4" color="0000ff"><b><font size="-1">
Index: lib/style/common/templates/confirmData.tmpl
===================================================================
--- lib/style/common/templates/confirmData.tmpl	(revision 2026)
+++ lib/style/common/templates/confirmData.tmpl	(revision 2027)
@@ -246,6 +246,12 @@
 <hr>
 <a name="KeywordInformation"></a>
 <p><b><font size="4" color="#0000ff">KEYWORD INFORMATION</font></b> 
+
+    [% numKey = 0 %]
+    [% IF keyCount > 0 %]
+        [% numKey = keyCount %]
+    [% END %]
+
 <table cellspacing="0" border="0" cellpadding="9" width="760">
     <tr> 
       <td width="21%" valign="TOP"> 
@@ -258,116 +264,24 @@
         <p><font size="-1"><b>Keyword Thesaurus</b></font></p>
       </td>
     </tr>
-    <tr> 
+    [% cnt = 1 %]
+    [% WHILE cnt <= numKey %]
+     [% SET key = "keyword${cnt}" %]
+     [% SET keyType = "kwType${cnt}" %]
+     [% SET keyTh = "kwTh${cnt}" %]
+     <tr> 
       <td width="21%" valign="TOP"> 
-        [%keyword0%]
+        [% $key %]
       </td>
       <td width="21%" valign="TOP"> 
-        [%kwType0%]
+        [% $keyType %]
       </td>
       <td width="58%" valign="TOP"> 
-	[%kwTh0%]
+	[% $keyTh %]
       </td>
-    </tr>
-    <tr> 
-      <td width="21%" valign="TOP"> 
-        [%keyword1%]
-      </td>
-      <td width="21%" valign="TOP"> 
-        [%kwType1%]
-      </td>
-      <td width="58%" valign="TOP"> 
-	[%kwTh1%]
-      </td>
-    </tr>
-    <tr> 
-      <td width="21%" valign="TOP"> 
-        [%keyword2%]
-      </td>
-      <td width="21%" valign="TOP"> 
-        [%kwType2%]
-      </td>
-      <td width="58%" valign="TOP"> 
-	[%kwTh2%]
-      </td>
-    </tr>
-    <tr> 
-      <td width="21%" valign="TOP"> 
-        [%keyword3%]
-      </td>
-      <td width="21%" valign="TOP"> 
-        [%kwType3%]
-      </td>
-      <td width="58%" valign="TOP"> 
-	[%kwTh3%]
-      </td>
-    </tr>
-    <tr> 
-      <td width="21%" valign="TOP"> 
-        [%keyword4%]
-      </td>
-      <td width="21%" valign="TOP"> 
-        [%kwType4%]
-      </td>
-      <td width="58%" valign="TOP"> 
-	[%kwTh4%]
-      </td>
-    </tr>
-    <tr> 
-      <td width="21%" valign="TOP"> 
-        [%keyword5%]
-      </td>
-      <td width="21%" valign="TOP"> 
-        [%kwType5%]
-      </td>
-      <td width="58%" valign="TOP"> 
-	[%kwTh5%]
-      </td>
-    </tr>
-    <tr> 
-      <td width="21%" valign="TOP"> 
-        [%keyword6%]
-      </td>
-      <td width="21%" valign="TOP"> 
-        [%kwType6%]
-      </td>
-      <td width="58%" valign="TOP"> 
-	[%kwTh6%]
-      </td>
-    </tr>
-    <tr> 
-      <td width="21%" valign="TOP"> 
-        [%keyword7%]
-      </td>
-      <td width="21%" valign="TOP"> 
-        [%kwType7%]
-      </td>
-      <td width="58%" valign="TOP"> 
-	[%kwTh7%]
-      </td>
-    </tr>
-    <tr> 
-      <td width="21%" valign="TOP"> 
-        [%keyword8%]
-      </td>
-      <td width="21%" valign="TOP"> 
-        [%kwType8%]
-      </td>
-      <td width="58%" valign="TOP"> 
-	[%kwTh8%]
-      </td>
-    </tr>
-    <tr> 
-      <td width="21%" valign="TOP"> 
-        [%keyword9%]
-      </td>
-      <td width="21%" valign="TOP"> 
-        [%kwType9%]
-      </td>
-      <td width="58%" valign="TOP"> 
-	[%kwTh9%]
-      </td>
-    </tr>
+     </tr>
+     [% cnt = cnt + 1 %]
+     [% END %]
   </table>
 <hr>
 <a name="TemporalCoverageOfData"></a>
@@ -652,36 +566,17 @@
   <input type="hidden" name="origNamelast10" value="[%origNamelast10%]">
   <input type="hidden" name="origRole10" value="[%origRole10%]">
   <input type="hidden" name="abstract" value="[%abstract%]">
-  <input type="hidden" name="keyword0" value="[%keyword0%]">
-  <input type="hidden" name="kwType0" value="[%kwType0%]">
-  <input type="hidden" name="kwTh0" value="[%kwTh0%]">
-  <input type="hidden" name="keyword1" value="[%keyword1%]">
-  <input type="hidden" name="kwType1" value="[%kwType1%]">
-  <input type="hidden" name="kwTh1" value="[%kwTh1%]">
-  <input type="hidden" name="keyword2" value="[%keyword2%]">
-  <input type="hidden" name="kwType2" value="[%kwType2%]">
-  <input type="hidden" name="kwTh2" value="[%kwTh2%]">
-  <input type="hidden" name="keyword3" value="[%keyword3%]">
-  <input type="hidden" name="kwType3" value="[%kwType3%]">
-  <input type="hidden" name="kwTh3" value="[%kwTh3%]">
-  <input type="hidden" name="keyword4" value="[%keyword4%]">
-  <input type="hidden" name="kwType4" value="[%kwType4%]">
-  <input type="hidden" name="kwTh4" value="[%kwTh4%]">
-  <input type="hidden" name="keyword5" value="[%keyword5%]">
-  <input type="hidden" name="kwType5" value="[%kwType5%]">
-  <input type="hidden" name="kwTh5" value="[%kwTh5%]">
-  <input type="hidden" name="keyword6" value="[%keyword6%]">
-  <input type="hidden" name="kwType6" value="[%kwType6%]">
-  <input type="hidden" name="kwTh6" value="[%kwTh6%]">
-  <input type="hidden" name="keyword7" value="[%keyword7%]">
-  <input type="hidden" name="kwType7" value="[%kwType7%]">
-  <input type="hidden" name="kwTh7" value="[%kwTh7%]">
-  <input type="hidden" name="keyword8" value="[%keyword8%]">
-  <input type="hidden" name="kwType8" value="[%kwType8%]">
-  <input type="hidden" name="kwTh8" value="[%kwTh8%]">
-  <input type="hidden" name="keyword9" value="[%keyword9%]">
-  <input type="hidden" name="kwType9" value="[%kwType9%]">
-  <input type="hidden" name="kwTh9" value="[%kwTh9%]">
+  <input type="hidden" name="keyCount" value="[%keyCount%]">
+  [% cnt = 1 %]
+  [% WHILE cnt <= numKey %]
+      [% SET kyd = "keyword${cnt}" %]
+      [% SET keyType = "kwType${cnt}" %]
+      [% SET keyTh = "kwTh${cnt}" %]
+      <input type="hidden" name="[% kyd %]" value="[% $kyd %]">
+      <input type="hidden" name="[% keyType %]" value="[% $keyType %]">
+      <input type="hidden" name="[% keyTh %]" value="[% $keyTh %]">
+      [% cnt = cnt + 1 %]
+  [% END %]
   <input type="hidden" name="addComments" value="[%addComments%]">
   <input type="hidden" name="useConstraints" value="[%useConstraints%]">
   <input type="hidden" name="useConstraintsOther" value="[%useConstraintsOther%]">
Index: lib/style/common/templates/genericResponse.tmpl
===================================================================
--- lib/style/common/templates/genericResponse.tmpl	(revision 2026)
+++ lib/style/common/templates/genericResponse.tmpl	(revision 2027)
@@ -115,36 +115,21 @@
   <input type="hidden" name="origNamelast10" value="[%origNamelast10%]">
   <input type="hidden" name="origRole10" value="[%origRole10%]">
   <input type="hidden" name="abstract" value="[%abstract%]">
-  <input type="hidden" name="keyword0" value="[%keyword0%]">
-  <input type="hidden" name="kwType0" value="[%kwType0%]">
-  <input type="hidden" name="kwTh0" value="[%kwTh0%]">
-  <input type="hidden" name="keyword1" value="[%keyword1%]">
-  <input type="hidden" name="kwType1" value="[%kwType1%]">
-  <input type="hidden" name="kwTh1" value="[%kwTh1%]">
-  <input type="hidden" name="keyword2" value="[%keyword2%]">
-  <input type="hidden" name="kwType2" value="[%kwType2%]">
-  <input type="hidden" name="kwTh2" value="[%kwTh2%]">
-  <input type="hidden" name="keyword3" value="[%keyword3%]">
-  <input type="hidden" name="kwType3" value="[%kwType3%]">
-  <input type="hidden" name="kwTh3" value="[%kwTh3%]">
-  <input type="hidden" name="keyword4" value="[%keyword4%]">
-  <input type="hidden" name="kwType4" value="[%kwType4%]">
-  <input type="hidden" name="kwTh4" value="[%kwTh4%]">
-  <input type="hidden" name="keyword5" value="[%keyword5%]">
-  <input type="hidden" name="kwType5" value="[%kwType5%]">
-  <input type="hidden" name="kwTh5" value="[%kwTh5%]">
-  <input type="hidden" name="keyword6" value="[%keyword6%]">
-  <input type="hidden" name="kwType6" value="[%kwType6%]">
-  <input type="hidden" name="kwTh6" value="[%kwTh6%]">
-  <input type="hidden" name="keyword7" value="[%keyword7%]">
-  <input type="hidden" name="kwType7" value="[%kwType7%]">
-  <input type="hidden" name="kwTh7" value="[%kwTh7%]">
-  <input type="hidden" name="keyword8" value="[%keyword8%]">
-  <input type="hidden" name="kwType8" value="[%kwType8%]">
-  <input type="hidden" name="kwTh8" value="[%kwTh8%]">
-  <input type="hidden" name="keyword9" value="[%keyword9%]">
-  <input type="hidden" name="kwType9" value="[%kwType9%]">
-  <input type="hidden" name="kwTh9" value="[%kwTh9%]">
+  <input type="hidden" name="keyCount" value="[%keyCount%]">
+  [% numKey = 0 %]
+    [% IF keyCount > 0 %]
+        [% numKey = keyCount %]
+    [% END %]
+  [% cnt = 1 %]
+  [% WHILE cnt <= numKey %]
+      [% SET kyd = "keyword${cnt}" %]
+      [% SET keyType = "kwType${cnt}" %]
+      [% SET keyTh = "kwTh${cnt}" %]
+      <input type="hidden" name="[% kyd %]" value="[% $kyd %]">
+      <input type="hidden" name="[% keyType %]" value="[% $keyType %]">
+      <input type="hidden" name="[% keyTh %]" value="[% $keyTh %]">
+      [% cnt = cnt + 1 %]
+  [% END %]
   <input type="hidden" name="addComments" value="[%addComments%]">
   <input type="hidden" name="useConstraints" value="[%useConstraints%]">
   <input type="hidden" name="useConstraintsOther" value="[%useConstraintsOther%]">
