" size="8" maxlength="10"> | |||||||
" size="8" maxlength="10"> | |||||||
" size="8" maxlength="10"> | |||||||
" size="8" maxlength="10"> | |||||||
" size="8" maxlength="10"> |
[此贴子已经被作者于2005-1-15 13:43:40编辑过]
[CODE]<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> </head> <script language="JavaScript" type="text/JavaScript"> function next(i) { if(event.keyCode==40) document.form1.txt[i+4].focus(); } </script> <body> <form name="form1"> <table border="1" width="100%"> <tr> <td width="25%"><input type="text" size="20" name="txt" onKeyUp="next(0)" ></td> <td width="25%"> <input type="text" size="20" name="txt" onKeyUp="next(1)"> </td> <td width="25%"><input type="text" size="20" name="txt" onKeyUp="next(2)" > </td> <td width="25%"> <input type="text" size="20" name="txt" onKeyUp="next(3)"> </td> </tr> <tr> <td width="25%"> <input type="text" size="20" name="txt" onKeyUp="next(4)"> </td> <td width="25%"> <input type="text" size="20" name="txt" onKeyUp="next(5)"> </td> <td width="25%"><input type="text" size="20" name="txt" onKeyUp="next(6)"> </td> <td width="25%"><input type="text" size="20" name="txt" onKeyUp="next(7)" > </td> </tr> <tr> <td width="25%"> <input type="text" size="20" name="txt" onKeyUp="next(8)"> </td> <td width="25%"><input type="text" size="20" name="txt" onKeyUp="next(9)"> </td> <td width="25%"><input type="text" size="20" name="txt" onKeyUp="next(10)"> </td> <td width="25%"><input type="text" size="20" name="txt" onKeyUp="next(11)"> </td> </tr> <tr> <td width="25%"><input type="text" size="20" name="txt"> </td> <td width="25%"><input type="text" size="20" name="txt"> </td> <td width="25%"><input type="text" size="20" name="txt"> </td> <td width="25%"><input type="text" size="20" name="txt"> </td> </tr> </table> </form> </body> </html>[/CODE]
这个办法很笨,但是你先用一下! 我还在做另外一个不需要onKeyUp="next(i)"的做法 但是还有点问题没有解决 做好了在传上来!
[CODE]<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> </head> <body> <script language="JavaScript" type="text/JavaScript"> function document.onkeyup() { var num ; //确定是第几个INPUT var l; l = document.form1.length; //FORM内INPUT的个数 for(var i =0;i<=l;i++){ if(event.srcElement == document.form1.T[i]) num = i ; } if(num<12){ if(event.srcElement.tagName=="INPUT") { if(event.keyCode==40) document.form1.T[num+4].focus(); //4是每行的INPUT数目 } } } </script> <form name="form1">
<table border="1" width="100%"> <tr> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> </tr> <tr> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> </tr> <tr> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> </tr> <tr> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> <td width="25%"><input type="text" name="T" size="20"></td> </tr> </table> </form> </body> </html>[/CODE]
这个不需要哪个调用函数了 自己看看吧!