title: What JavaScript function will auto-submit a Qualtrics survey?
body: <p>What JavaScript function will auto-submit a Qualtrics survey? I want to create a button in the header or footer of a Qualtrics survey that will automatically submit the survey whenever the user wants to quit. It seems like a pretty standard feature for survey software to have. <strong>The question may not seem well researched but that's because there are NO Qualtrics resources out there on this.</strong></p>
  <p>I found parts of the Qualtrics JS that might be relevant:</p>
  <pre><code>function pressSubmitButtonOnEnter(evt, id) {
      if (evt.keyCode == Event.KEY_RETURN) {
          Event.stop(evt);
          $(id).click();
          return false;
      }
  }
  </code></pre>
  <p>This one as well:</p>
  <pre><code>function submitForm(formID) {
      var form = $(formID);
      if (form) {
          Event.fire(form, 'submit');
          if (form.onsubmit)
              form.onsubmit();
          if (form.submit)
              form.submit();
          return true;
      }
  }
  function submitFormJumpTo(formID, jumpTo) {
      $(formID).action = jumpTo;
      submitForm(formID);
  }
  </code></pre>
  <p>This:</p>
  <pre><code>var SEonSubmit = {
      add : function (onSubmitFunction) {
          Event.observe('Page', 'submit', onSubmitFunction);
      }
  };
  var SEonClick = {
      add : function (onClickFunction) {
          Event.observe('Page', 'click', onClickFunction);
      }
  };
  </code></pre>