<script> function checkstu(){ if(document.forms.stu.std_name.value =="") { alert("กรุณากรอกชื่อด้วย"); //alert with appropriate message document.forms.stu.std_name.select(); //place cursor on the input box return false; } if(document.forms.stu.std_email.value =="") { alert("กรุณากรอกอีเมล์ด้วยน่ะค่ะ"); //alert with appropriate message document.forms.stu.std_email.select(); //place cursor on the input box return false; } a=document.stu.std_email.value; var l=a.length-1; var s=a.indexOf("@"); var d=a.lastIndexOf("."); var s2=a.lastIndexOf("@"); if(a.charAt(0)=="@"|| a.charAt(l)=="@"||d-s<3|| a.charAt(0)=="."||a.charAt(l)=="."|| a.length<8||s!=s2||a.indexOf("@")==-1|| a.indexOf(" ")!=-1||a.indexOf("*")!=-1|| a.indexOf("/")!=-1||a.indexOf("&")!=-1|| a.indexOf("<")!=-1||a.indexOf(">")!=-1|| a.indexOf("?")!=-1||a.indexOf("|")!=-1|| a.indexOf(":")!=-1||a.indexOf(",")!=-1|| a.indexOf("=")!=-1||a.indexOf(")")!=-1|| a.indexOf("(")!=-1||a.indexOf("%")!=-1|| a.indexOf("#")!=-1) { alert("อีเมล์ไม่ถูกต้องน่ะค่ะ"); document.stu.std_email.focus(); return false; } if(document.forms.stu.std_user.value == "") { alert("กรุณากรอก username ด้วย"); //alert with appropriate message document.forms.stu.std_user.select(); //place cursor on the input box return false; } if(document.forms.stu.std_user.value.length<5){ alert("กรอก username อย่างน้อย 5 ตัวอักษร"); //alert with appropriate message(document.forms.stu.username.value.length>20) document.forms.stu.std_user.select(); //place cursor on the input box return false; } if(document.forms.stu.std_user.value.length>20){ alert("กรุณากรอก username ไม่เกิน 20 ตัวอักษรแล้วค่ะ"); //alert with appropriate message(document.forms.stu.username.value.length>20) document.forms.stu.std_user.select(); //place cursor on the input box return false; } if(document.forms.stu.std_password.value =="") { alert("กรุณากรอก password ด้วยน่ะค่ะ"); //alert with appropriate message document.forms.stu.std_password.select(); //place cursor on the input box return false; } if(document.forms.stu.std_password.value.length<5){ alert("กรอก password อย่างน้อย 5 ตัวอักษร"); //alert with appropriate message(document.forms.stu.username.value.length>20) document.forms.stu.std_password.select(); //place cursor on the input box return false; } if(document.forms.stu.std_password.value.length>20){ alert("กรุณากรอก password ไม่เกิน 20 ตัวอักษรแล้วค่ะ"); //alert with appropriate message(document.forms.stu.username.value.length>20) document.forms.stu.std_password.select(); //place cursor on the input box return false; } } </script>
<?php <form action="registerdo.php" method="post" enctype="multipart/form-data" name="stu" onSubmit="return checkstu();"> <table width="90%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td colspan="2"><h4 align="center" class="style2 style5"><font color="#0033CC">กรุณากรอกแบบฟอร์มข้างล่างนี้ให้ครบทุกช่องและกดปุ่ม ลงทะเบียน<br>ผู้เรียนจะต้องกรอกทุกช่องที่มีเครื่องหมาย</font> <font color="#0033CC"><span class="style9">*</span> </font></h4></td> </tr> <tr> <td width="30%"><div align="right" class="style5"><font color="#FF0000">*</font> <font face="MS Sans Serif">ชื่อ นามสกุล </font></div></td> <td width="70%"><input name="std_name" type="text" class="style5" id="std_name" size="30"/></td> </tr> <tr> <td height="24"><div align="right"><span class="style5"><font color="#FF0000">*</font> <font face="MS Sans Serif">อีเมล์</font></span><font face="MS Sans Serif"><span class="style3"></span></font></div></td> <td><input name="std_email" type="text" class="style5" id="std_email" size="30"/></td> </tr> <tr> <td height="31" colspan="2"><div align="center"> <h4> </h4> <h4><span class="style3 style5 style6"><font color="#0000FF"><b><font color="#0033CC">ชื่อใช้สำหรับเข้าสู่ระบบผู้เรียน (กรอก Username และ Password)</font></b></font></span><font color="#5C7E32"><b> <label></label> </b> <label></label> </font></h4> </div> <b><font color="#0000FF"> <label></label> </font></b><label></label></td> </tr> <tr> <td><div align="right" class="style5"><font color="#FF0000" face="MS Sans Serif">* </font> <font face="MS Sans Serif">Username</font></div></td> <td><input name="std_user" type="text" class="style5" id="std_user" size="30"/></td> </tr> <tr> <td><div align="right" class="style5"><font color="#FF0000" face="MS Sans Serif">* </font> <font face="MS Sans Serif">Password</font></div></td> <td><input name="std_password" type="password" class="style5" id="std_password" size="30"/></td> </tr> <tr> <tr> <td> </td> <td><label> <input type="submit" name="Submit" value="ลงทะเบียน" /> <input type="reset" name="Submit" value="ยกเลิก" /> </label></td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </form> ?>
<script> function checkstu(){ if(document.forms.stu.std_name.value =="") { alert("กรุณากรอกชื่อด้วย"); //alert with appropriate message document.forms.stu.std_name.select(); //place cursor on the input box return false; } if(document.forms.stu.std_email.value =="") { alert("กรุณากรอกอีเมล์ด้วยน่ะค่ะ"); //alert with appropriate message document.forms.stu.std_email.select(); //place cursor on the input box return false; } a=document.stu.std_email.value; var l=a.length-1; var s=a.indexOf("@"); var d=a.lastIndexOf("."); var s2=a.lastIndexOf("@"); if(a.charAt(0)=="@"|| a.charAt(l)=="@"||d-s<3|| a.charAt(0)=="."||a.charAt(l)=="."|| a.length<8||s!=s2||a.indexOf("@")==-1|| a.indexOf(" ")!=-1||a.indexOf("*")!=-1|| a.indexOf("/")!=-1||a.indexOf("&")!=-1|| a.indexOf("<")!=-1||a.indexOf(">")!=-1|| a.indexOf("?")!=-1||a.indexOf("|")!=-1|| a.indexOf(":")!=-1||a.indexOf(",")!=-1|| a.indexOf("=")!=-1||a.indexOf(")")!=-1|| a.indexOf("(")!=-1||a.indexOf("%")!=-1|| a.indexOf("#")!=-1) { alert("อีเมล์ไม่ถูกต้องน่ะค่ะ"); document.stu.std_email.focus(); return false; } if(document.forms.stu.std_user.value == "") { alert("กรุณากรอก username ด้วย"); //alert with appropriate message document.forms.stu.std_user.select(); //place cursor on the input box return false; } if(document.forms.stu.std_user.value.length<5){ alert("กรอก username อย่างน้อย 5 ตัวอักษร"); //alert with appropriate message(document.forms.stu.username.value.length>20) document.forms.stu.std_user.select(); //place cursor on the input box return false; } if(document.forms.stu.std_user.value.length>20){ alert("กรุณากรอก username ไม่เกิน 20 ตัวอักษรแล้วค่ะ"); //alert with appropriate message(document.forms.stu.username.value.length>20) document.forms.stu.std_user.select(); //place cursor on the input box return false; } if(document.forms.stu.std_password.value =="") { alert("กรุณากรอก password ด้วยน่ะค่ะ"); //alert with appropriate message document.forms.stu.std_password.select(); //place cursor on the input box return false; } if(document.forms.stu.std_password.value.length<5){ alert("กรอก password อย่างน้อย 5 ตัวอักษร"); //alert with appropriate message(document.forms.stu.username.value.length>20) document.forms.stu.std_password.select(); //place cursor on the input box return false; } if(document.forms.stu.std_password.value.length>20){ alert("กรุณากรอก password ไม่เกิน 20 ตัวอักษรแล้วค่ะ"); //alert with appropriate message(document.forms.stu.username.value.length>20) document.forms.stu.std_password.select(); //place cursor on the input box return false; } } </script> <form action="registerdo.php" method="post" enctype="multipart/form-data" name="stu" onSubmit="return checkstu();"> <table width="90%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td colspan="2"><h4 align="center" class="style2 style5"><font color="#0033CC">กรุณากรอกแบบฟอร์มข้างล่างนี้ให้ครบทุกช่องและกดปุ่ม ลงทะเบียน<br>ผู้เรียนจะต้องกรอกทุกช่องที่มีเครื่องหมาย</font> <font color="#0033CC"><span class="style9">*</span> </font></h4></td> </tr> <tr> <td width="30%"><div align="right" class="style5"><font color="#FF0000">*</font> <font face="MS Sans Serif">ชื่อ นามสกุล </font></div></td> <td width="70%"><input name="std_name" type="text" class="style5" id="std_name" size="30"/></td> </tr> <tr> <td height="24"><div align="right"><span class="style5"><font color="#FF0000">*</font> <font face="MS Sans Serif">อีเมล์</font></span><font face="MS Sans Serif"><span class="style3"></span></font></div></td> <td><input name="std_email" type="text" class="style5" id="std_email" size="30"/></td> </tr> <tr> <td height="31" colspan="2"><div align="center"> <h4> </h4> <h4><span class="style3 style5 style6"><font color="#0000FF"><b><font color="#0033CC">ชื่อใช้สำหรับเข้าสู่ระบบผู้เรียน (กรอก Username และ Password)</font></b></font></span><font color="#5C7E32"><b> <label></label> </b> <label></label> </font></h4> </div> <b><font color="#0000FF"> <label></label> </font></b><label></label></td> </tr> <tr> <td><div align="right" class="style5"><font color="#FF0000" face="MS Sans Serif">* </font> <font face="MS Sans Serif">Username</font></div></td> <td><input name="std_user" type="text" class="style5" id="std_user" size="30"/></td> </tr> <tr> <td><div align="right" class="style5"><font color="#FF0000" face="MS Sans Serif">* </font> <font face="MS Sans Serif">Password</font></div></td> <td><input name="std_password" type="password" class="style5" id="std_password" size="30"/></td> </tr> <tr> <tr> <td> </td> <td><label> <input type="submit" name="Submit" value="ลงทะเบียน" /> <input type="reset" name="Submit" value="ยกเลิก" /> </label></td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </form> ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง