|
|
|
JavaScript ไม่ตรวจสอบฟิลด์ทำไงดีคับ ทำไม JavaScript ไม่ตรวจสอบฟิลด์ใน Textbox อ่ะคับนี้โคว์คับ ขอบคุณคับ |
|
|
|
|
|
|
|
ทำไมJAVAไม่ตรวจสอบฟิลด์ในtaxtboxอ่ะคับนี้โคว์คับ ขอบคุณคับ
<?php
session_start();
?>
<html>
<head>
<title>- :บันทึกข้อมูล :</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link rel="shortcut icon" href="zom.ico">
<link href="lover.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-image: url();
background-color: #C6EEA7;
}
-->
</style></head>
<script language="JavaScript">
var flag=0;
function checkapplymember(){
var v1 = document.applymember.IDMember.value;
var v2 = document.applymember.pwmember.value;
var v3 = document.applymember.DayApply.value;
var v4 = document.applymember.names.value;
var v5 = document.applymember.people.value;
var v6 = document.applymember.address.value;
var v7 = document.applymember.province.value;
var v8 = document.applymember.Padvise.value;
var v9 = document.applymember.Nadvise.value;
var v10 = document.applymember.Pup.value;
var v11 = document.applymember.Nup.value;
if ( v1.length == ""){
alert("กรุณาใส่รหัสสมาชิก");
document.applymember.IDMember.focus();
return false;
}
else if (v2.length == ""){
alert("กรุณาใส่รหัสผ่านสมาชิก");
document.applymember.pwmember.focus();
return false;
}
else if (v3.length == ""){
alert("กรุณาใสวันที่ลงทะเบียน");
document.applymember.DayApply.focus();
return false;
}
else if (v4.length == ""){
alert("กรุณาใส่ชื่อ-นามสกุล");
document.applymember.names.focus();
return false;
}
else if (v5.length == ""){
alert("กรุณาใส่รหัสบัตรประชาชน");
document.applymember.people.focus();
return false;
}
else if (v5.length <= 12){
alert("กรุณาใส่รหัสบัตรประชาชนให้ครบ 13 หลัก");
document.applymember.people.focus();
return false;
}
else if (v6.length == ""){
alert("กรุณาใส่ที่อยู่");
document.applymember.address.focus();
return false;
}
else if (v7.length == ""){
alert("กรุณาใส่จังหวัด-รหัสไปษณี");
document.applymember.province.focus();
return false;
}
else if (v8.length == ""){
alert("กรุณาใส่รหัสผู้แนะนำ");
document.applymember.Padvise.focus();
return false;
}
else if (v9.length == ""){
alert("กรุณาใส่ชื่อผู้แนะนำ");
document.applymember.Nadvise.focus();
return false;
}
else if (v10.length == ""){
alert("กรุณาใส่รหัสอัพไลน์");
document.applymember.Pup.focus();
return false;
}
else if (v11.length == ""){
alert("กรุณาใส่ชื่ออัพไลน์");
document.applymember.Nup.focus();
return false;
}
else
flag=1;
return true;
}
</script>
<body>
<div align="left">
<?php
include("common/config.php");
include("common/common.php");
DbConnection();
mysql_query("SET NAMES 'tis620'");
$sql = "INSERT INTO applymember
(IDMember , pwmember , DayApply , names, people, birthday,address, province, phon, Bookbank ,bankAccount ,Padvise ,Nadvise ,Pup ,Nup,beside )
VALUES
('$IDMember' , '$pwmember' , '$DayApply','$names', '$people','$birthday', '$address', '$province', '$phon', '$Bookbank', '$bankAccount', '$Padvise', '$Nadvise', '$Pup','$Nup','$beside')";/////แทรกที่ตาราง1
mysql_query($sql, $conn);
mysql_close();
?>
</div>
<table width="770" height="662" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td height="111" colspan="3"><?php include("brand_inc.php");?></div></td>
<tr>
<td width="160" valign="top"><?php include("menu_main.php");?></td>
<td width="847" valign="top"><form id="applymember" name="applymember" method="post" action="">
<table width="822" border="0">
<tr>
<td height="34" class="style23"><div align="right">รหัสสมาชิก:</div></td>
<td><input name="IDMember" type="text" style="font-family: Comic Sans MS" id="IDMember4" size="10" maxlength="9" />
<span class="style10">
<input type="submit" name="button" id="button" value=" ค้นหา " class="content03" style="font-weight:bold;" />
</span></td>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td height="34" class="style23"><div align="right"> รหัสผ่าน:</div></td>
<td align="left" valign="top">
<input name="pwmember" type="text" style="font-family: Comic Sans MS" id="pwMember2" size="6" maxlength="6" /> </td>
<td><div align="right"><span class="style23">รหัสผู้แนะนำ:</span></div></td>
<td colspan="2"><div align="left"><span class="style3">
<input name="Padvise" type="text" style="font-family: Comic Sans MS" id="Padvise" size="10" maxlength="9" />
</span></div></td>
</tr>
<tr>
<td width="176" height="30" class="style29"><div align="right" class="style23"><span class="style7">วันที่สมัค</span>ร: </div></td>
<td width="237"><input name="DayApply" type="text" style="font-family: Comic Sans MS" id="DayApply2" size="10" maxlength="10" /></td>
<td><div align="right"><span class="style23">ชื่อ-นามสกุล:</span></div></td>
<td colspan="2">
<div align="left">
<input name="Nadvise" type="text" style="font-family: Comic Sans MS" id="Nadvise" size="30" maxlength="50" />
</div></td></tr>
<tr>
<td height="31" class="style3"><div align="left" class="style23">
<div align="right" class="style23">ชื่อ-นามสกุล:</div>
</div>
</div></td>
<td><input name="names" type="text" style="font-family: Comic Sans MS" id="names" size="30" maxlength="50" /></td>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td height="31"><div align="right"><span class="style23">เลขประจำตัวประชาชน:</span></div></td>
<td><input name="people" type="text" style="font-family: 'Comic Sans MS' id="people" size="15" maxlength="13" /></td>
<td class="style23"><div align="right">รหัสผู้ Up:</div></td>
<td colspan="2" class="style3"><div align="left">
<input name="Pup" type="text" style="font-family: Comic Sans MS" id="Pup" size="10" maxlength="9" />
</div></td>
</tr>
<tr>
<td height="32"><div align="right"><span class="style23">ว/ด/ป เกิด: </span></div></td>
<td><span class="style3">
<input name="birthday" type="text" style="font-family: 'Comic Sans MS' id="birthday" size="10" maxlength="10" />
</span></td>
<td><div align="right"><span class="style23">ชื่อ-นามสกุล:</span></div></td>
<td colspan="2">
<div align="left">
<input name="Nup" type="text" style="font-family: Comic Sans MS" id="Nup" size="30" maxlength="50" />
</div></td>
</tr>
<tr>
<td height="79"><div align="right"><span class="style3"><span class="style23">ที่อยู่: </span></span></div></td>
<td bgcolor="#D4F1B9"><span class="style3">
<textarea name="address" cols="29" rows="4" style="font-family: 'Comic Sans MS' id="address" ></textarea>
</span></td>
<td width="96" class="style3"> </td>
<td colspan="2" valign="top"><label for="radiobutton"></label> <table width="225" border="0">
<tr>
<th width="59" align="left" scope="col">A
<input name="beside" type="radio" value="1" id="radiobutton" />
<label for="radiobutton"></label>
<label for="radiobutton"></label></th>
<th width="59" align="left" scope="col">ฺB
<input name="beside" type="radio" value="2" id="radio" />
<label for="radio"></label></th>
<th width="93" align="left" scope="col">C
<input name="beside" type="radio" value="3" id="radio2" />
<label for="radio2"></label></th>
</tr>
</table> <label for="radio"></label>
<span class="style3">
<br />
<input type="submit" name="submit" id="submit" value=" บันทึก " class="content03" />
<input name="Delete" type="reset" id="Delete" value="ลบ" />
</span></td>
</tr>
<tr>
<td height="34"><div align="right"><span class="style23">จังหวัด-รหัสไปรษณี: </span></div></td>
<td><span class="style3">
<input name="province" type="text" style="font-family: 'Comic Sans MS' id="province" size="30" maxlength="35" />
</span></td>
<td><div align="right"></div></td>
<td colspan="2"><div align="left"></div></td>
</tr>
<tr>
<td height="38" class="style3"><div align="right" class="style23">
<div align="right">เบอร์โทร:</div>
</div></td>
<td><input name="Phon" type="text" style="font-family: Comic Sans MS" id="Phon" size="30" maxlength="50" /></td>
<td><label for="imageField"></label></td>
<td width="179"> </td>
<td width="112"> </td>
</tr>
<tr>
<td height="33" class="style3"><div align="right" class="style23">
<div align="right">ธนาคาร-สาขา:</div>
</div></td>
<td><input name="Bookbank" type="text" style="font-family: Comic Sans MS" id="Bookbank3" size="30" maxlength="40" /></td>
<td><div align="right"></div></td>
<td><div align="center"></div></td>
<td><div align="left"></div></td>
</tr>
<tr>
<td height="31" class="style23"><div align="right">เลขที่บัญชี:</div></td>
<td><input name="BankAccount" type="text" style="font-family: Comic Sans MS" id="BankAccount4" size="13" maxlength="13" /></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td width="3"> </td>
</tr>
</table>
</body>
</html>
<? DbCloseConnection(); ?>
Tag : - - - -
|
|
|
|
|
|
Date :
2009-07-21 11:01:20 |
By :
gofgof |
View :
1051 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|