    hiddenField.setAttribute("type", "hidden");
          hiddenField.setAttribute("name", "username");
          hiddenField.setAttribute("value", username);
          form.appendChild(hiddenField);
           */

          document.body.appendChild(form);
          form.submit();
      }

      // check username for registration
      function validateUsername(str) {
            var error = "";
            var illegalChars = /\W/; // allow letters, numbers, and underscores

            if (str == "") {
  