<html> <head> <title>ThaiCreate.Com Tutorial</title> </head> <body> <form name="frmMain" action="" method="post"> <script language="JavaScript"> document.onkeydown = chkEvent var formInUse = false; function chkEvent(e) { var keycode; if (window.event) keycode = window.event.keyCode; //*** for IE ***// else if (e) keycode = e.which; //*** for Firefox ***// if(keycode==8) { return false; } } </script> Textbox 1 <input type="text" name="txt1" value=""> <br> Textbox 2 <input type="text" name="txt2" value=""> <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 var formInUse = false; function chkEvent(e) { var keycode; if (window.event) keycode = window.event.keyCode; //*** for IE ***// else if (e) keycode = e.which; //*** for Firefox ***// if(keycode==8 && formInUse==false) { return false; } } </script> Textbox 1 <input type="text" name="txt1" onfocus="formInUse = true;" onblur="formInUse = false;" value=""> <br> Textbox 2 <input type="text" name="txt2" onfocus="formInUse = true;" onblur="formInUse = false;" value=""> <br> Textbox 3 <input type="text" name="txt3" onfocus="formInUse = true;" onblur="formInUse = false;" value=""><br> <input type="submit" name="btnSubmit" value="Submit"> </form> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท