<!doctype> <html> <head> <style type="text/css"> .focus { border: solid 1px #444 !important; background-color: yellow; } input[type=text] { padding: 3px; margin: 5px; border: solid 1px #eee; } .error { border: solid 1px #f00 !important; } </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> $( document ).ready(function(){ $("#test").focus().addClass("focus"); $("input[type=text]").focus(function(){ $(this).addClass("focus"); }); $("input[type=text]").blur(function(){ $(this).removeClass("focus"); }); $("form").submit(function(){ if($("input[type=text]").val()==""){ $("input[type=text]").addClass("error"); return false; } alert(" SEND DATA"); $("input[type=text]").removeClass("error"); return false; }); }); </script> </head> <title>On Focus !!!</title> <!------------------------------> <body> <form action="" method="POST"> <input type="text" id="test" name="test" /><br> <input type="text" name="txt_box" /><br> <input type="text" name="txt_box" /><br> <input type="text" name="txt_box" /><br> <input type="text" name="txt_box" /><br> <input type="submit" name="submit" value="Save"> </form> </body>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง