docs: public static void renderClearHiddenCommandFormParamsFunction(
              ResponseWriter writer, String formName, Set dummyFormParams,
              String formTarget) throws IOException
      {
          //render the clear hidden inputs javascript function
          String functionName = getClearHiddenCommandFormParamsFunctionName(formName);
          writer.startElement(HTML.SCRIPT_ELEM, null);
          writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
  
          // Using writeComment instead of write with <!-- tag
          StringBuilder script = new StringBuilder();
          script.append("function ");
          script.append(functionName);
          script.append("() {");
          if (dummyFormParams != null)
          {
              script.append("\n  var f = document.forms['");
              script.append(formName);
              script.append("'];");
              int i = 0;
              for (Iterator it = dummyFormParams.iterator(); it.hasNext();)
              {
                  String elemVarName = "elem" + i;
                  script.append("\n  var ").append(elemVarName).append(" = ");
                  script.append("f.elements['").append((String) it.next())
                          .append("'];");
                  script.append("\n  if(typeof ").append(elemVarName)
                          .append(" !='undefined' && ");
                  script.append(elemVarName).append(".nodeName=='INPUT'){");
                  script.append("\n   if (").append(elemVarName)
                          .append(".value != '') {");
                  script.append("\n    " + elemVarName + ".value='';");
                  script.append("\n   }");
                  script.append("\n  }");
                  i++;
              }
          }
          // clear form target
          script.append("\n  f.target=");
          if (formTarget == null || formTarget.length() == 0)
          {
              //Normally one would think that setting target to null has the
              //desired effect, but once again IE is different...
              //Setting target to null causes IE to open a new window!
              script.append("'';");
          }
          else
          {
              script.append("'");
              script.append(formTarget);
              script.append("';");
          }
          script.append("\n}");
  
          //Just to be sure we call this clear method on each load.
          //Otherwise in the case, that someone submits a form by pressing Enter
          //within a text input, the hidden inputs won't be cleared!
          script.append("\n");
          script.append(functionName);
          script.append("();");
  
          writer.writeText(script.toString(), null);
          writer.endElement(HTML.SCRIPT_ELEM);
      }