Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,028

HOME > PHP > PHP Forum > ผมทำเว็บรับสมัครนักเรียนครับ เจอปัญหาการกรอกเกรดเฉลี่ย มีวิธีการล็อคให้พิมพ์ได้แค่ตัวเลขที่มีจุดทศนิยมไหมครับ



 

ผมทำเว็บรับสมัครนักเรียนครับ เจอปัญหาการกรอกเกรดเฉลี่ย มีวิธีการล็อคให้พิมพ์ได้แค่ตัวเลขที่มีจุดทศนิยมไหมครับ

 



Topic : 129909



โพสกระทู้ ( 6 )
บทความ ( 0 )



สถานะออฟไลน์




ผมทำเว็บรับสมัครนักเรียนครับ เจอปัญหาการกรอกเกรดเฉลี่ย มีวิธีการล็อคให้พิมพ์ได้แค่ตัวเลขที่มีจุดทศนิยมไหมครับ
เพราะเจอเด็กพิมพ์เป็นข้อความบ่อยมากครับ ลองจำกัดให้พิมพ์ได้แค่ตัวเลข ก็ดันพิมพ์จุดไม่ได้ครับ
ขอท่านกูรูช่วยชี้แนะหน่อยครับ

ปัญหา



Tag : PHP, MySQL, HTML, JavaScript, Ajax, jQuery







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2018-01-10 21:04:45 By : komaao View : 1548 Reply : 5
 

 

No. 1



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


เอาโค๊ดมาลงไว้ด้วยครับ จะได้ช่วยแก้ไขให้






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-01-10 21:20:22 By : Chaidhanan
 


 

No. 2



โพสกระทู้ ( 6 )
บทความ ( 0 )



สถานะออฟไลน์


อย่างยาวเลยครับ ต้องขออภัยครับ

Code (PHP)
<SCRIPT language=JavaScript>
function check_number() {
e_k=event.keyCode;
if (e_k != 13 && (e_k < 48) || (e_k > 57)) {
event.returnValue = false;
alert("กรุณาป้อนตัวเลขเท่านั้น.");
}
}//end function 
</script>

<script type="text/javascript">
<!-- Begin
function checkCode() {
if (form2.code2.value.length != 13)
 { 
  alert("กรุณากรอก รหัสบัตรประชาชน ให้ถูกต้องและครบ 13 หลัก");form2.code2.focus();return (false);
}
return true;
}
var rco = <?=$rc?>;
function checkFields() {
if (form1.su.value == 0)
 { 
 alert("กรุณาเลือก คำนำหน้า ด้วย");form1.su.focus();return (false);
}
if (form1.name.value == "")
 { 
 alert("กรุณากรอก ชื่อ-สกุลผู้สมัคร ด้วย");form1.name.focus();return (false);
}
if (form1.code.value == "")
 { 
 alert("กรุณากรอก รหัสบัตรประชาชน ด้วย");form1.code.focus();return (false);
}
if (form1.code.value.length != 13)
 { 
 alert("กรุณากรอก รหัสบัตรประชาชน ให้ถูกต้องและครบ 13 หลัก");form1.code.focus();return (false);
}
if (form1.d1.value == 0)
 { 
 alert("กรุณากรอก วันที่เกิด ด้วย");form1.d1.focus();return (false);
}
if (form1.m1.value == 0)
 { 
 alert("กรุณากรอก เดือนที่เกิด ด้วย");form1.m1.focus();return (false);
}
if (form1.y1.value == 0)
 { 
 alert("กรุณากรอก ปีที่เกิด ด้วย");form1.y1.focus();return (false);
}
if (form1.nf.value == "")
 { 
 alert("กรุณากรอก ชื่อผู้ปกครองของท่าน ด้วย");form1.nf.focus();return (false);
}
if (form1.t1.value == "")
 { 
 alert("กรุณากรอก เบอร์โทรศัพท์ที่สามารถติดต่อได้ ด้วย");form1.t1.focus();return (false);
}
if (form1.add1.value == "")
 { 
 alert("กรุณากรอก ที่อยู่ของท่านที่สามารถติดต่อได้ ด้วย");form1.add1.focus();return (false);
}
if (form1.rcode.value == "")
 { 
 alert("กรุณากรอกรหัสปลอดภัยให้ถูกต้อง");form1.rcode.focus();return (false);
}
if (form1.de.value == 0)
 { 
 alert("กรุณากรอกชั้นเรียนที่สำเร็จการศึกษา");form1.de.focus();return (false);
}
if (form1.olds.value == "")
 { 
 alert("กรุณากรอกชื่อโรงเรียนที่สำเร็จการศึกษา");form1.olds.focus();return (false);
}
if (form1.add2.value == "")
 { 
 alert("กรุณากรอกที่อยู่เรียนเรียนที่สำเร็จการศึกษา");form1.add2.focus();return (false);
}
if (form1.ged1.value == "")
 { 
 alert("กรุณากรอกเกรดเฉลี่ยสะสม ป.1 - ป.5");form1.ged1.focus();return (false);
}

if (form1.ged2.value == "")
 { 
 alert("กรุณากรอกเกรดเฉลี่ยสะสมของวิชาวิทยาศาสตร์ กับ คณิตศาสตร์");form1.ged2.focus();return (false);
}
if (form1.ged1.value > 4.00)
 { 
 alert("กรุณากรอกเกรดเฉลี่ยสะสม ป.1 - ป.5 ให้ถูกต้อง");form1.ged1.focus();return (false);
}
if (form1.ged2.value > 4.00)
 { 
 alert("กรุณากรอกเกรดเฉลี่ยสะสมของวิชาวิทยาศาสตร์ กับ คณิตศาสตร์ ให้ถูกต้อง");form1.ged2.focus();return (false);
}
if (form1.c1.value == 0)
 { 
 alert("กรุณากรอกห้องเรียนลำดับที่ 1");form1.c1.focus();return (false);
}
if (form1.c1.value == 0 && form1.c3.value!=0)
 { 
 alert("กรุณากรอกห้องเรียนลำดับที่ 2");form1.c2.focus();return (false);
}
if (form1.c1.value == form1.c2.value)
 { 
 alert("ห้องเรียนลำดับที่ 2 ซ้ำกับห้องเรียนลำดับที่ 1");form1.c2.focus();return (false);
}
if (form1.c1.value == form1.c3.value)
 { 
 alert("ห้องเรียนลำดับที่ 3 ซ้ำกับห้องเรียนลำดับที่ 1");form1.c3.focus();return (false);
}
if(form1.c2.value !=0 && form1.c3.value!=0){
if (form1.c2.value == form1.c3.value)
 { 
 alert("ห้องเรียนลำดับที่ 3 ซ้ำกับห้องเรียนลำดับที่ 2");form1.c3.focus();return (false);
}
}
if (form1.rcode.value == "")
 { 
 alert("กรุณากรอกรหัสปลอดภัยให้ถูกต้อง");form1.rcode.focus();return (false);
}
if (form1.rcode.value != rco)
 { 
 alert("กรุณากรอกรหัสปลอดภัยให้ถูกต้อง");form1.rcode.focus();return (false);
}
return true;
}
// End -->
</script>

<link href="../css/style.css" rel="stylesheet" type="text/css">
<body >
<table width="1024" border="0" cellpadding="0" cellspacing="0" bgcolor="#FF33FF">
  <tr>
    <td width="112">&nbsp;</td>
    <td width="800">&nbsp;</td>
    <td width="112">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><p><img src="images/icon/main-small.jpg" width="800" height="150"></p></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td width="7%">&nbsp;</td>
        <td width="90%">&nbsp;</td>
        <td width="3%">&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center" class="style7">ข้อมูลผู้สมัครสอบเข้าศึกษาในระดับชั้นมัธยมศึกษาปีที่ 1  </td>
        <td class="style7">&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td class="style33">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>
         <?php 
		$code2=$_POST[code2];
		if($code2==""){?>
        <form name="form2" method="post"  action="#"onSubmit="return checkCode(this)">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="5" align="center" class="style5">กรอกข้อมูลผู้สมัคร</td>
    </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="36%" align="right"><span class="style3">&nbsp;เลขบัตรประชาชน</span></td>
    <td width="1%">&nbsp;</td>
    <td width="24%"><input name="code2" type="text" id="code2" onKeyPress=check_number(); maxlength="13"></td>
    <td width="20%"><input type="submit" name="ch_code" id="ch_code" value="ตรวจสอบ"></td>
    <td width="19%">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2"><span class="style55">ตัวอย่าง 1579900001888 ( เลขบัตรที่ขึ้นด้วย G ให้เปลี่ยนเป็น 0 )</span></td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
<?php }else{
	//วันทีปัจจุบัน
	$dt1 = date("Y-m-d");
	$e1 = explode("-", $dt1);
	$ey1 = $e1[0]+543;
    $em1 = $e1[1];
	$ed1 = $e1[2];
	
	
	mysql_select_db($database_condb_crres, $condb_crres);
	$q_a1 = "SELECT * FROM res_m1 WHERE res_code='$code2'";
	$ra1 = mysql_query($q_a1, $condb_crres) or die(mysql_error());
	$row_a1 = mysql_fetch_assoc($ra1);
	$totalRows_a1 = mysql_num_rows($ra1);
	//echo "$totalRows_a1";
	if($totalRows_a1!=0){
			echo "<body onload=\"window.alert('ตรวจสอบจากรหัสบัตรประชาชนพบว่าท่านเคยสมัครแล้ว\\n- หากท่านต้องการพิมพ์ใบสมัครท่านต้องดำเนินการจ่ายเงินค่าสมัครก่อน\\n- หลังจากบันทึกหากท่านต้องการแก้ไขข้อมูลให้ติดต่อแก้ไขกับโรงเรียนโดยตรง');return history.go(-1)\">";
		}
	
	?>
        <form name="form1" method="post"  action="pages/r-2-3-s.php"onSubmit="return checkFields(this)" >
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="39" colspan="3" class="style7">ข้อมูลทั่วไป</td>
              <td width="17%" class="style5">&nbsp;</td>
              <td width="1%" class="style5">&nbsp;</td>
              <td width="30%" class="style5">&nbsp;</td>
            </tr>
			<tr>
              <td height="32" colspan="4" align="center" valign="bottom" class="style55">ให้ใช้คำนำหน้าเป็นตัวย่อ ด.ช./ด.ญ./น.ส./นาย ตัวอย่าง ด.ช.มานะ&nbsp; ทำดี </td>
              <td class="style5">&nbsp;</td>
              <td valign="bottom" class="style55">&nbsp;</td>
            </tr>
            <tr>
              <td width="19%" height="32" class="style3">ชื่อ-สกุลผู้สมัคร</td>
              <td width="1%" class="style5">&nbsp;</td>
              <td class="style3"><select name="su" id="su">
                <option value="0">คำนำหน้า</option>
                <option value="1">ด.ช.</option>
                <option value="2">ด.ญ.</option>
                <option value="3">นาย</option>
                <option value="4">น.ส.</option>
                </select>&nbsp; &nbsp;
                <label>ชื่อ :
                  <input name="name1" type="text" id="name1" size="10">
                  &nbsp;</label></td>
              <td colspan="3" class="style3"><label> สกุล :
                <input name="name2" type="text" id="name2" size="10">
              </label>
&nbsp;</td>
              </tr>
            <tr>
              <td height="31" class="style3">เลขบัตรประชาชน</td>
              <td class="style5">&nbsp;</td>
              <td width="32%" class="style5"><input name="code" type="text" id="code" onBlur="return check_idcard(this)" onKeyPress=check_number(); value="<?php echo"$code2";?>" size="26" maxlength="13"></td>
              <td colspan="3" class="style55">ตัวอย่าง 1579900001888 ( เลขบัตรที่ขึ้นด้วย G ให้เปลี่ยนเป็น 0 )</td>
              </tr>
            <tr>
              <td height="31" class="style3">วัน/เดือน/ปีเกิด</td>
              <td class="style5">&nbsp;</td>
              <td class="style5">
			  <select name="d1" id="d1">
			  <option value="0">วัน</option>
			   <?  $d1=1; $n1=1;
			   while ($d1<32) {
				?>
				<option value="<?= $n1;?>"><?= $d1;?></option>
				<?  $d1++; $n1++;}?>
              </select>&nbsp;
			  <select name="m1" id="m1">
			  <option value="0">  เดือน  </option>
			  <?  $n2=1;
			   $m1 = array("1"=>"มกราคม",  "2"=>"กุมภาพันธ์",  "3"=>"มีนาคม",  
    "4"=>"เมษายน",  "5"=>"พฤษภาคม",  "6"=>"มิถุนายน",  
    "7"=>"กรกฎาคม",  "8"=>"สิงหาคม",  "9"=>"กันยายน",  
    "10"=>"ตุลาคม", "11"=>"พฤศจิกายน",  "12"=>"ธันวาคม");
			   while ($n2<13) {
								?>
								<option value="<?= $n2;?>"><?= $m1[$n2];?></option>
								<?   $n2++;}?>
              </select>&nbsp;
			  <select name="y1" id="y1">
			  <option value="0">ปี</option>
			  <?  $y1=2535; $n3=1;
			   while ($y1<$ey1) {
								?>
								<option value="<?= $y1;?>"><?= $y1;?></option>
								<?  $y1++; $n3++;}?>
              </select>              </td>
              <td class="style55">&nbsp;</td>
              <td class="style55">&nbsp;</td>
              <td valign="bottom" class="style55">ตัวอย่าง 0810000123</td>
              </tr>
            <tr>
              <td height="31" class="style3">ชื่อ-สกุลผู้ปกครอง</td>
              <td class="style5">&nbsp;</td>
              <td class="style5"><input name="nf" type="text" id="nf" size="30"></td>
              <td class="style3">&nbsp;&nbsp;เบอร์โทรติดต่อ</td>
              <td class="style5">&nbsp;</td>
              <td class="style5"><input name="t1" type="text" id="t1" size="20" onKeyPress=check_number(); ></td>
            </tr>
            <tr>
              <td height="61" class="style3">ที่อยู่ที่ติดต่อได้</td>
              <td class="style5">&nbsp;</td>
              <td colspan="4" class="style5"><textarea name="add1" cols="60" rows="3" id="add1"></textarea></td>
              </tr>
            <tr>
              <td height="40" colspan="3" class="style7">ข้อมูลการศึกษา</td>
              <td class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
            </tr>
            <tr>
              <td height="37" colspan="6" class="style5"><span class="style3">สำเร็จการศึกษาหรือกำลังศึกษาอยู่ชั้น&nbsp;&nbsp;
                <input name="de" type="text" id="de" size="10" value="ป.6" >
&nbsp;&nbsp;&nbsp;&nbsp;ชื่อสถานศึกษา 
<input name="olds" type="text" id="olds" size="30" value="โรงเรียน">
              <span class="style55">ตัวอย่าง โรงเรียนบ้านทุ่งวิทยา</span></span></td>
              </tr>
            <tr>
              <td height="39" class="style5"><span class="style3">จังหวัดที่โรงเรียนตั้ง</span></td>
              <td class="style5">&nbsp;</td>
              <td colspan="4" class="style5"><span class="style3">
                <input name="add2" type="text" id="add2" size="40">
                <span class="style55">ตัวอย่าง เชียงราย</span></span></td>
            </tr>
            <tr>
              <td height="35" align="center" class="style5"><span class="style3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
              <td height="35" align="center" class="style5">&nbsp;</td>
              <td height="35" align="left" class="style5"><span class="style3">เกรดเฉลี่ยสะสม ป.4 - ป.5&nbsp;</span></td>
              <td colspan="3" align="left" class="style5"><span class="style3">เกรดเฉลี่ยสะสม วิทยาศาสตร์ - คณิตศาสตร์ &nbsp;</span></td>
              </tr>
            <tr>
              <td height="36" align="center" class="style5"></td>
              <td height="36" align="center" class="style5">&nbsp;</td>
              <td height="36" align="left" class="style5"><span class="style3">
                <input name="ged1" type="text" id="ged1" size="20"> 
                <span class="style55">ตัวอย่าง 3.50</span></span></td>
              <td colspan="3" align="left" class="style5"><span class="style3">
                <input name="ged2" type="text" id="ged2" size="20" >
              </span></td>
              </tr>
            <tr>
              <td height="30" colspan="4" class="style5"><span class="style3">รางวัลจากการประกวดแข่งขันระดับภาค หรือระดับประเทศ(ถ้ามี) </span></td>
              <td class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
            </tr>
            <tr>
              <td height="62" class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
              <td colspan="4" class="style5"><span class="style3">
                <textarea name="aw" cols="60" rows="3" id="aw"></textarea>
              </span></td>
              </tr>
            <tr>
              <td height="39" class="style5"><span class="style3">ห้องเรียนลำดับที่ 1 </span></td>
              <td class="style5">&nbsp;</td>
              <td colspan="4" class="style5">
                <span class="style3">
                <select name="c1" id="c1">
                  <option value="0">เลือกห้องเรียน</option>
                  <?php 
			  	mysql_select_db($database_condb_crres, $condb_crres);
				$q_pro1 = "SELECT * FROM res_pro WHERE pro_status='2'";
				$rpro1 = mysql_query($q_pro1, $condb_crres) or die(mysql_error());
				$totalRows_pro1 = mysql_num_rows($rpro1);
				
				$npro=1;
			   while ($npro<=$totalRows_pro1) {
				   $row_pro1 = mysql_fetch_assoc($rpro1);
			  ?>
                  <option value="<?php echo"$row_pro1[pro_id]";?>"><?php echo"$row_pro1[pro_namethai]( $row_pro1[pro_mininame] )";?> </option>
                  <?php $npro++;}?>
                </select>
                &nbsp;</span></td>
              </tr>
            <tr>
              <td height="43" class="style5"><span class="style3">ห้องเรียนลำดับที่ 2 </span></td>
              <td class="style5">&nbsp;</td>
              <td colspan="4" class="style5">
                <span class="style3">
                <select name="c2" id="c2">
                  <option value="0">เลือกห้องเรียน</option>
                  <?php 
			  	mysql_select_db($database_condb_crres, $condb_crres);
				$q_pro1 = "SELECT * FROM res_pro WHERE pro_status='2'";
				$rpro1 = mysql_query($q_pro1, $condb_crres) or die(mysql_error());
				$totalRows_pro1 = mysql_num_rows($rpro1);
				
				$npro=1;
			   while ($npro<=$totalRows_pro1) {
				   $row_pro1 = mysql_fetch_assoc($rpro1);
			  ?>
                  <option value="<?php echo"$row_pro1[pro_id]";?>"><?php echo"$row_pro1[pro_namethai]( $row_pro1[pro_mininame] )";?> </option>
                  <?php $npro++;}?>
                </select>
                &nbsp; </span></td>
              </tr>
            <tr>
              <td height="40" class="style5"><span class="style3">ห้องเรียนลำดับที่ 3 </span></td>
              <td class="style5">&nbsp;</td>
              <td colspan="4" class="style5">
                <span class="style3">
                <select name="c3" id="c3">
                  <option value="0">เลือกห้องเรียน</option>
                  <?php 
			  	mysql_select_db($database_condb_crres, $condb_crres);
				$q_pro1 = "SELECT * FROM res_pro WHERE pro_status='2'";
				$rpro1 = mysql_query($q_pro1, $condb_crres) or die(mysql_error());
				 $totalRows_pro1 = mysql_num_rows($rpro1);
				
				$npro=1;
			   while ($npro<=$totalRows_pro1) {
				   $row_pro1 = mysql_fetch_assoc($rpro1);
			  ?>
                  <option value="<?php echo"$row_pro1[pro_id]";?>"><?php echo"$row_pro1[pro_namethai]( $row_pro1[pro_mininame] )";?> </option>
                  <?php $npro++;}?>
                </select>
                </span></td>
              </tr>
            <tr class="style2">
              <td height="22" align="right" class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
              <td colspan="4" class="style5">&nbsp;</td>
            </tr>
            <tr>
              <td height="22" align="right" class="style5"><span class="style51">
                <input name="ch2" type="checkbox" id="ch2" value="1">
              </span></td>
              <td class="style5">&nbsp;</td>
              <td colspan="4" class="style5"><span class="style51">กรณีหลักฐานการศึกษาไม่ครบ</span></td>
              </tr>
            <tr>
              <td height="22" class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
              <td class="style5">&nbsp;</td>
            </tr>
            <tr>
			
              <td height="22" colspan="6" align="center" class="style5"><img src="images/icon/<? echo "$rc";?>.gif" width="157" height="47" border="1"></td>
            </tr>
            <tr>
              <td height="22" colspan="6" align="center" class="style5">&nbsp;</td>
            </tr>
            <tr>
              <td height="22" colspan="6" align="center" class="style5">กรอกตัวเลขที่เห็นด้านบน&nbsp; <input name="rcode" type="text" id="rcode" size="15"></td>
            </tr>
            <tr>
              <td height="22" colspan="6" align="right" class="style5"><a href="index.php"><img src="images/icon/home.gif" border="0"></a></td>
            </tr>
            <tr>
              <td height="22" colspan="6" class="style5"><div align="center">
                <input type="submit" name="Submit" value="ลงทะเบียน">
              &nbsp;&nbsp;&nbsp; 
              <input type="reset" name="Submit2" value="ล้างข้อมูล">
              </div></td>
              </tr>
          </table>
                </form>
                
                <?php }?>
        </td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
    </table></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-01-10 21:26:51 By : komaao
 

 

No. 3



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


เอา tag ภาษา php ครอบหน่อยครับ อยู่เหนือช่องกรอกข้อความ ขวามือ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-01-11 13:54:17 By : Chaidhanan
 


 

No. 4



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


ดูจากโค๊ดแล้วไม่ได้ใช้ feature ของ html5 มาใช้งานเลยนะครับ

ลองศึกษา พวก attribute ของ tag input เช่น required pattern placeholder title นำมาใช้ประโยชน์ให้มากหน่อยครับ

ส่วนวิธีการเช็ค จุดทศนิยม

Code (JavaScript)
if( !(/^[0-9]+\.[0-9]+$/).test)input.value){
    alert('ต้องเป็นตัวเลขรูปแบบ  999.999'); 
}


อีกอย่าง อะไรที่มันซ้ำๆ กัน ลองทำเป็น function ไว้ใช้ โค๊ดจะได้สั้นลง
Code (JavaScript)
function chk(ob, txt){
	if (ob.value.length == 0){
		alert( txt); ob.focus();return false;
	}else return true;
}
function checkFields() {
	if (! chk(form1.su, "กรุณาเลือก คำนำหน้า ด้วย")) { return false; }
	if (! chk(form1.name, "กรุณากรอก ชื่อ-สกุลผู้สมัคร ด้วย")){ return false; }
	...
}

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-01-11 14:11:17 By : Chaidhanan
 


 

No. 5



โพสกระทู้ ( 6 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณมากครับพี่


ประวัติการแก้ไข
2018-01-11 17:45:55
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2018-01-11 17:45:33 By : komaao
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ผมทำเว็บรับสมัครนักเรียนครับ เจอปัญหาการกรอกเกรดเฉลี่ย มีวิธีการล็อคให้พิมพ์ได้แค่ตัวเลขที่มีจุดทศนิยมไหมครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่