Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try something like this. This works fine in Chrome and Firefox too. </p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;script&gt; function fieldFocus(e, obj){ var key; if (window.event) key = e.keyCode; else if (e.which) key = e.which; if (!e.shiftKey &amp;&amp; key === 9) { // do validate if (0 !== obj.value.length){ return true; } else{ e.stopPropagation(); e.preventDefault(); } } return false; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" id="first-field" onkeydown="fieldFocus(event, this);" /&gt; &lt;input type="text" id="second-field" onkeydown="fieldFocus(event, this);" /&gt; &lt;input type="text" id="third-field" onkeydown="fieldFocus(event, this);" /&gt; &lt;input type="text" id="fourth-field" onkeydown="fieldFocus(event, this);" /&gt; &lt;input type="text" id="fifth-field" onkeydown="fieldFocus(event, this);" /&gt; &lt;input type="text" id="sixth-field" onkeydown="fieldFocus(event, this);" /&gt; &lt;/body&gt; </code></pre> <p></p> <p>Please note this is a sample code for your reference since the way you fire the function is not mentioned in your code. You can use jQuery to easily call the function for <code>keydown</code> event instead of calling it for all input element like <code>onkeydown = functionName(&lt;params&gt;)</code>. Hope this would help you.</p> <p><strong>Updated: Same code but jQuery integrated</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;script src="jquery-1.8.2.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $('.input-element').each(function(index, value){ $(value).keydown(function(event){ fieldFocus(event, this); }); }); function fieldFocus(e, obj){ var key; if (window.event) key = e.keyCode; else if (e.which) key = e.which; if (!e.shiftKey &amp;&amp; key === 9) { // do validate if (0 !== obj.value.length){ return true; } else{ e.stopPropagation(); e.preventDefault(); } } return false; } }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" id="first-field" class="input-element" /&gt; &lt;input type="text" id="second-field" class="input-element" /&gt; &lt;input type="text" id="third-field" class="input-element" /&gt; &lt;input type="text" id="fourth-field" class="input-element" /&gt; &lt;input type="text" id="fifth-field" class="input-element" /&gt; &lt;input type="text" id="sixth-field" class="input-element" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload