title: How to move focus on next field when enter is pressed?
body: <p>Can you please tell me how to move focus on to the next field when the enter key is press? I use the <code>dform</code> plugin (which converts JSON to a form). </p>
  
  <p>I Googled it, but this not working. Why doesn't my focus move on to the next field?</p>
  
  <h2>JSFiddle: <a href="http://jsfiddle.net/5WkVW/1/" rel="noreferrer">http://jsfiddle.net/5WkVW/1/</a></h2>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).keypress(function(e) {
          if(e.which == 13) {
      
                  // Do something here if the popup is open
                  alert("dd")
                  var index = $('.ui-dform-text').index(this) + 1;
                  $('.ui-dform-text').eq(index).focus();
              
          }
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form id="testSuiteConfigurationform" name="testSuiteConfigurationform" method="post" class="ui-dform-form" novalidate="novalidate"&gt;
      &lt;label class="ui-dform-label"&gt;
          &lt;h3&gt;Configuration Parameters&lt;/h3&gt;
      &lt;/label&gt;
      &lt;div class="ui-dform-div inputDiv"&gt;
          &lt;fieldset class="ui-dform-fieldset"&gt;
              &lt;input type="text" id="totalRetryCount" name="totalRetryCount" tabindex="1" onblur="validateElement('Configuration', 'testSuiteConfigurationform','totalRetryCount')" class="ui-dform-text valid"&gt;
              &lt;legend class="ui-dform-legend"&gt;Total Retry Count&lt;/legend&gt;
              &lt;label for="totalRetryCount" class="checked"&gt;✔&lt;/label&gt;
          &lt;/fieldset&gt;
          &lt;fieldset class="ui-dform-fieldset"&gt;
              &lt;input type="text" id="totalRepeatCount" name="totalRepeatCount" tabindex="2" onblur="validateElement('Configuration', 'testSuiteConfigurationform','totalRepeatCount')" class="ui-dform-text"&gt;
              &lt;legend class="ui-dform-legend"&gt;Total Repeat Count&lt;/legend&gt;
          &lt;/fieldset&gt;
          &lt;fieldset class="ui-dform-fieldset"&gt;
              &lt;select id="summaryReportRequired" name="summaryReportRequired" tabindex="3" onblur="validateElement('Configuration', 'testSuiteConfigurationform','summaryReportRequired')" class="ui-dform-select"&gt;
                  &lt;option class="ui-dform-option" value="true"&gt;true&lt;/option&gt;
                  &lt;option class="ui-dform-option" value="false"&gt;false&lt;/option&gt;
              &lt;/select&gt;
              &lt;legend class="ui-dform-legend"&gt;Summary Report Required&lt;/legend&gt;
          &lt;/fieldset&gt;
          &lt;fieldset class="ui-dform-fieldset"&gt;
              &lt;select id="postConditionExecution" name="postConditionExecution" tabindex="4" onblur="validateElement('Configuration', 'testSuiteConfigurationform','postConditionExecution')" class="ui-dform-select"&gt;
                  &lt;option class="ui-dform-option" value="ALWAYS"&gt;ALWAYS&lt;/option&gt;
                  &lt;option class="ui-dform-option" value="ON_SUCCESS"&gt;ON_SUCCESS&lt;/option&gt;
              &lt;/select&gt;
              &lt;legend class="ui-dform-legend"&gt;Post Condition Execution&lt;/legend&gt;
          &lt;/fieldset&gt;
      &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>*Note (from comments): <em>It also needs to work on pages that do not have <code>tabindex</code> values set</em></p>