what will be the code to move to previous textfield?
<p>i have the code if i press down button it goes to next textfield but to go to previous textfield what should be the code ...</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script language="JavaScript"&gt;
function handleKeyDownEvent(elementRef,eventRef)
{ 
 var charCode = (window.event) ? eventRef.keyCode : eventRef.which;

 //alert(charCode);

 // Arrow keys (37:left, 38:up, 39:right, 40:down)...




if (charCode == 40)
 {
  if (window.event)
   window.event.keyCode = 9;
  else
   event.which = 9;

  return true;
 } 



 return true;
}



&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table width="433" border="1" cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
                &lt;td width="235" align="center"&gt;&lt;input type="text" onKeyDown="handleKeyDownEvent(this,event);" onKeyUp="handleKeyUpEvent(this,event);"&gt;&lt;/td&gt;
                &lt;td width="235"  align="center"&gt;&lt;input type="text" onKeyDown="handleKeyDownEvent(this,event);" onKeyUp="handleKeyUpEvent(this,event);"&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
                &lt;td width="235"  align="center"&gt;&lt;input type="text" onKeyDown="handleKeyDownEvent(this,event);" onKeyUp="handleKeyUpEvent(this,event);"&gt;&lt;/td&gt;
                &lt;td width="235"  align="center"&gt;&lt;input type="text" onKeyDown="handleKeyDownEvent(this,event);" onKeyUp="handleKeyUpEvent(this,event);"&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
        &lt;td&gt;
        &lt;input type="radio" id="check" name="check" checked&gt;
        &lt;/td&gt;
        &lt;td&gt;
        &lt;input type="radio" id="check" name="check" checked&gt;
        &lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
          &lt;td&gt;&lt;input type="checkbox" id="check" name="check"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="checkbox" id="check" name="check"&gt;&lt;/td&gt;
      &lt;/tr&gt;

&lt;/table&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
