function checkKeycode(e){ var keycode; var element = document.forms[0].elements; //alert(document.forms[0].elements[f].type); //alert(element.length); if (window.event) keycode = window.event.keyCode; // ใช้ IE อ่ะ else if (e) keycode = e.which; // ใช้ Firefox เน่าะ if(keycode==13 && f<=element.length){ document.forms[0].elements[f].focus(); f=f+1; return false; } } f=0; document.onkeydown = checkKeycode;
<form name="form1"> <input name="text1" onKeyDown="if(event.keyCode==13){ document.form1.text2.focus()}"> <input name="text2" onKeyDown="if(event.keyCode==13){ document.form1.text3.focus()}" onKeyUp="if(event.keyCode==38){ document.form1.text1.focus()}"> <input name="text3" onKeyUp="if(event.keyCode==38){ document.form1.text2.focus()}"> </form>
<script> function event_button(){ if(window.event.keyCode == 39){ window.event.keyCode = 9; } } </script> วันที่: <input type="text" value="<?=date('d');?>" size="2"/>- <input type="text" value="<?=date('m');?>" size="2"/>-<input type="text" value="<?=date('Y');?>" size="4"/>
<html> <head> <title>ThaiCreate.Com Tutorial</title> </head> <body> <form name="frmMain" action="" method="post"> <script language="JavaScript"> document.onkeydown = chkEvent function chkEvent(e) { var keycode; if (window.event) keycode = window.event.keyCode; //*** for IE ***// else if (e) keycode = e.which; //*** for Firefox ***// if(keycode==13) { return false; } } function setNextFocus(objId){ if (event.keyCode == 13){ var obj=document.getElementById(objId); if (obj){ obj.focus(); } } } </script> Textbox 1 <input type="text" name="txt1" value="" onKeyDown="setNextFocus('txt2');"> <br> Textbox 2 <input type="text" name="txt2" value="" onKeyDown="setNextFocus('txt3');"> <br> Textbox 3 <input type="text" name="txt3" value=""><br> <input type="submit" name="btnSubmit" value="Submit"> </form> </body> </html>
<html> <head> <title>ThaiCreate.Com Tutorial</title> </head> <body> <form name="frmMain" action="" method="post"> <script language="JavaScript"> document.onkeydown = chkEvent function chkEvent(e) { var keycode; if (window.event) keycode = window.event.keyCode; //*** for IE ***// else if (e) keycode = e.which; //*** for Firefox ***// if(keycode==13) { return false; } } function setNextFocus(objId){ if (event.keyCode == 13){ if(objId=='submit') { document.frmMain.submit(); } else { var obj=document.getElementById(objId); if (obj){ obj.focus(); } } } } </script> Textbox 1 <input type="text" name="txt1" value="" onKeyDown="setNextFocus('txt2');"> <br> Textbox 2 <input type="text" name="txt2" value="" onKeyDown="setNextFocus('txt3');"> <br> Textbox 3 <input type="text" name="txt3" value="" onKeyDown="setNextFocus('submit');"><br> <input type="submit" name="btnSubmit" value="Submit"> </form> </body> </html>
<tr> <td width="67"><div align="left" class="style6"><strong>ชื่อผู้เข้าใช้</strong></div></td> <td width="84"><label> <input name="A01" type="text" id="A01" size="7" maxlength="20" onKeyDown="setNextFocus('A02');"/> </label></td> </tr> <tr> <td><div align="left" class="style5">รหัสผ่าน</div></td> <td><label> <input name="A02" type="password" id="A02" size="7" maxlength="20" onKeyDown="setNextFocus('btnOK');"/> </label></td> </tr> <tr> <td colspan="2"><div align="center"> <input type="submit" name="btnOK" id="btnOK" value="ตกลง" onKeyDown="connect/checklogins.php"/>
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Test Scan Form</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $( document ).ready(function() { $( ".barcode" ).first().focus(); $( ".barcode" ).keypress(function( event ) { if ( event.which == 13 ) { event.preventDefault(); $(this).next().focus(); } }); }); </script> </head> <body> <?php if( isset($_POST['submit']) ) { print_r($_POST['barcode']); } ?> <form name="frm1" method="post" action=""> <input type="text" name="barcode[]" class="barcode"> <input type="text" name="barcode[]" class="barcode"> <input type="text" name="barcode[]" class="barcode"> <input type="submit" name="submit"> </form> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง