ช่วยทีนะครับ คิดไม่ออกว่าจะทำยังไง ดีครับ เกี่ยวกับการเช็กข้อมูล ครับ
คุณจะให้มันใช้งาน IsCheck ในตอนไหนล่ะคับ ถ้าหากจะให้มันทำตอน คลิก ตกลง ลองแบบนี้
<input type="button" name="btnAdd" value="ตกลง" style="width:100px" onclick="JavaScript:doCallAjax(); return IsCheck('txtName','txtOther','txtSize','txtSize1','txtPage','txt1','txt2','txt3','txt4','txt5','txtComment');"/>
ดูคับ
Date :
2011-11-22 11:41:56
By :
ไวยวิทย์
จะ IsCheck ตอนกดปุ๋ม ตกลง ครับ IsCheck ก่อนถ้าผ้านก็ค่อยไป onclick="JavaScript:doCallAjax(); อะครับ
Date :
2011-11-22 11:52:12
By :
tangsupap
ทำเป็นแบบนี้อย่างที่บอก ก็ยังไม่ได้ อะครับ
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>รายการพิมพ์</title>
<script language="JavaScript">
var HttPRequest = false;
function doCallAjax() {
HttPRequest = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
HttPRequest = new XMLHttpRequest();
if (HttPRequest.overrideMimeType) {
HttPRequest.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!HttPRequest) {
alert('Cannot create XMLHTTP instance');
return false;
}
if(confirm('คุณต้องการเพิ่มข้อมูลใช่ไหม')==true)
{
var url = 'fn_formA1_tab1.php?txtCode='+document.getElementById("txtCode").value+'&txtDate='+document.getElementById("txtDate").value
+'&txtName='+document.getElementById("txtName").value+'&SelWork='+document.getElementById("SelWork").value+'&txtOther='+document.getElementById("txtOther").value
+'&txtSize='+document.getElementById("txtSize").value+'&txtSize1='+document.getElementById("txtSize1").value+'&SelSize='+document.getElementById("SelSize").value
+'&txtPage='+document.getElementById("txtPage").value+'&SelBook='+document.getElementById("SelBook").value+'&txt1='+document.getElementById("txt1").value
+'&txt2='+document.getElementById("txt2").value+'&txt3='+document.getElementById("txt3").value+'&txt4='+document.getElementById("txt4").value+'&txt5='+document.getElementById("txt5").value
+'&txtComment='+document.getElementById("txtComment").value+'&txtCus='+document.getElementById("txtCus").value+'&txtEmp='+document.getElementById("txtEmp").value
+'&status='+document.getElementById("status").value;
HttPRequest.open('POST',url,true);
HttPRequest.send(null);
}
HttPRequest.onreadystatechange = function()
{
if(HttPRequest.readyState == 4) // Return Request
{
document.getElementById("mySpan").innerHTML = HttPRequest.responseText;
}
}
/*
HttPRequest.onreadystatechange = call function .... // Call other function
*/
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features).focus();
}
function searchResultSaleman(theURL,winName,features) { //v2.0
window.open(theURL,winName,features).focus();
}
function searchResultSaleman(){
var width = 1100;
var height = 300;
var diaxFeature="dialogWidth:"+width+"px;"
+"dialogHeight:"+height+"px;"
/*+"dialogLeft:"+width+"px;"
+"dialogTop:"+width+"px;"*/
+"center:yes;"
+"edge:raised;" // sunken | raised
+"resizable:no;"
+"status:no;"
+"scroll:no;";
var returnValue = window.showModalDialog("formA1_tab1_Bro2.php","", diaxFeature);
//alert("value is : "+returnValue);
var myStr=new Array();
myStr = returnValue.split("-");
document.getElementById("txtEmp").value = myStr[0];
document.getElementById("txtEmp1").value = myStr[1];
}
function onCancel(){
window.location='';
}
function onBack(){
window.location='formA1.php';
}
function IsCheck(txtName, txtOther, txtSize, txtSize1, txtPage, txt1, txt2, txt3, txt4, txt5, txtComment)
{
//alert(eText);
if(document.getElementById(txtName).value == ''
&& document.getElementById(txtOther).value == ''
&& document.getElementById(txtSize).value == ''
&& document.getElementById(txtSize1).value == ''
&& document.getElementById(txtPage).value == ''
&& document.getElementById(txt1).value == ''
&& document.getElementById(txt2).value == ''
&& document.getElementById(txt3).value == ''
&& document.getElementById(txt4).value == ''
&& document.getElementById(txt5).value == ''
&& document.getElementById(txtComment).value == ''
)
{
alert('กรุณาใส่ข้อมูล');
return false;
}
else if(document.getElementById(txtName).value == ''
|| document.getElementById(txtOther).value == ''
|| document.getElementById(txtSize).value == ''
|| document.getElementById(txtSize1).value == ''
|| document.getElementById(txtPage).value == ''
|| document.getElementById(txt1).value == ''
|| document.getElementById(txt2).value == ''
|| document.getElementById(txt3).value == ''
|| document.getElementById(txt4).value == ''
|| document.getElementById(txt5).value == ''
|| document.getElementById(txtComment).value == ''
)
{
alert('กรุณาใส่ข้อมูลให้ครบ');
return false;
}
var txtSizeFilter=/^([0-9]){1,}$/;
var txtSize=document.form1.txtSize.value;
if (!(txtSizeFilter.test(txtSize)))
{
alert ("ขนาดต้องป็นตัวเลข");
return false;
}
var txtSize1Filter=/^([0-9]){1,}$/;
var txtSize1=document.form1.txtSize1.value;
if (!(txtSize1Filter.test(txtSize1)))
{
alert ("ขนาดต้องป็นตัวเลข");
return false;
}
var txtPageFilter=/^([0-9]){1,}$/;
var txtPage=document.form1.txtPage.value;
if (!(txtPageFilter.test(txtPage)))
{
alert ("จำนวนต้องป็นตัวเลข");
return false;
}
var txt1Filter=/^([0-9]){1,}$/;
var txt1=document.form1.txt1.value;
if (!(txt1Filter.test(txt1)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt2Filter=/^([0-9]){1,}$/;
var txt2=document.form1.txt2.value;
if (!(txt2Filter.test(txt2)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt3Filter=/^([0-9]){1,}$/;
var txt3=document.form1.txt3.value;
if (!(txt3Filter.test(txt3)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt4Filter=/^([0-9]){1,}$/;
var txt4=document.form1.txt4.value;
if (!(txt4Filter.test(txt4)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt5Filter=/^([0-9]){1,}$/;
var txt5=document.form1.txt5.value;
if (!(txt5Filter.test(txt5)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
else
return true;
}
</script>
</head>
<body>
<form name="form1">
<span id="mySpan"></span>
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#0000FF">
<!--DWLayoutTable-->
<tr>
<td valign="top">
<table width="100%" border="1" align="center" bordercolor="#0099FF" bgcolor="#CCFFFF">
<tr>
<td width="128"><div align="right">เลขที่งาน :</div></td>
<td width="153"><div align="left">
<label>
<?=$LastID?>
<input type="hidden" name="txtCode" id="txtCode" disabled="disabled" value="<?=$LastID?>" />
</label>
</div></td>
<td width="142" colspan="3"><div align="right">วันที่ปรับปรุง :</div></td>
<td width="267"><div align="left">
<label>
<?=$CalDate?>
<input type="hidden" name="txtDate" id="txtDate" disabled="disabled" value="<?=$CalDate?>" />
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ชื่องาน :</div></td>
<td colspan="5"><div align="left">
<label>
<input name="txtName" id="txtName" type="text" size="100" value="<?=$JobName?>" />
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ลักษณะงาน :</div></td>
<td colspan="5"><div align="left">
<?php
echo "<label>";
$table_field1 = "JobTypeNo";
$table_field2 = "JobTypeName";
$strSQL= "SELECT JobTypeNo, JobTypeName FROM TBJobType";
$objConnect = mysql_connect($host,$user,$pass) or die("Error Connect to Database");
$objDB = mysql_select_db($db);
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
echo "<select name=\"SelWork\" id=\"SelWork\">";
while($row = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$row[$table_field1]?>" <? if($JobType != '' && $row[$table_field1] == $JobType){ echo "selected=\"selected\"";}?>><?=$row[$table_field2]?></option>
<?
}
echo "</select>";
echo "</label>";
?>
ระบุ
<label>
<input type="text" name="txtOther" id="txtOther" value="<?=$OthJobType?>" />
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ขนาด (กxย) :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txtSize" id="txtSize" value="<?=$PrdSizeW?>" />
</label>
x
<label>
<input type="text" name="txtSize1" id="txtSize1" value="<?=$PrdSizeH?>" />
</label>
<label>
<select name="SelSize" id="SelSize">
<option value="1" <? if($SizeID != '' && $SizeID == 1){ echo "selected=\"selected\"";}?>>นิ้ว</option>
<option value="2" <? if($SizeID != '' && $SizeID == 2){ echo "selected=\"selected\"";}?>>ซ.ม.</option>
</select>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">จำนวน :</div></td>
<td><div align="left">
<label>
<input name="txtPage" id="txtPage" type="text" size="10" value="<?=$QtyPage?>" />
</label>
หน้า
</div></td>
<td width="142"><div align="right">เข้าเล่ม :</div></td>
<td colspan="3"><div align="left">
<?php
echo "<label>";
require_once('connect.php');
$objConnect = mysql_connect($host,$user,$pass) or die("Error Connect to Database");
$objDB = mysql_select_db($db);
$table_field1 = "BindNo";
$table_field2 = "BindName";
$strSQL= "SELECT BindNo, BindName FROM TBBindType";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
echo "<select name=\"SelBook\" id=\"SelBook\">";
while($row = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$row[$table_field1]?>" <? if($BindType != '' && $row[$table_field1] == $BindType){ echo "selected=\"selected\"";}?>><?=$row[$table_field2]?></option>
<?
}
echo "</select>";
echo "</label>";
?>
</div></td>
</tr>
<tr>
<td><div align="right">ยอดพิมพ์ 1 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt1" id="txt1" value="<?=$QtyPrn1?>" />
</label>
<select name="unit1" id="unit1">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">2 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt2" id="txt2" value="<?=$QtyPrn2?>" />
</label>
<select name="unit2" id="unit2">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">3 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt3" id="txt3" value="<?=$QtyPrn3?>" />
</label>
<select name="unit3" id="unit3">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">4 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt4" id="txt4" value="<?=$QtyPrn4?>" />
</label>
<select name="unit4" id="unit4">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">5 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt5" id="txt5" value="<?=$QtyPrn5?>" />
</label>
<select name="unit5" id="unit5">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">หมายเหตุ :</div></td>
<td colspan="5"><div align="left">
<label>
<input name="txtComment" id="txtComment" type="text" size="100" value="<?=$JobRemark?>" />
</label>
<label></label>
</div></td>
</tr>
<tr>
<td><div align="right">ลูกค้า:</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txtCus" readonly="readonly" id="txtCus" value="<?=$CustID?>" />
<?
if($CustID != ''){
$strSQL = "SELECT company FROM TBcustomer WHERE CustID='$CustID'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);
$company=$objResult['company'];
}
?>
<input name="txtCus1" id="txtCus1" readonly="readonly" type="text" size="80" value="<?=$company?>" />
</label>
<label></label>
<label>
<input type="button" name="btnCus" value="Browes" style="width:100px" onclick="javascript:MM_openBrWindow('formA1_tab1_Bro1.php','pop','scrollbars=yes,width=1100,height=300')"/>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">พนักงานขาย :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txtEmp" id="txtEmp" readonly="readonly" value="<?=$SaleID?>" />
<?
if($SaleID != ''){
$strSQL = "SELECT FLName FROM TBsaleman WHERE SalemanID='$SaleID'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);
$FLName=$objResult['FLName'];
}
?>
<input name="txtEmp1" id="txtEmp1" readonly="readonly" type="text" size="80" value="<?=$FLName?>" />
</label>
<label></label>
<input type="button" name="btnEmp" value="Browes" style="width:100px" onclick="javascript:searchResultSaleman('formA1_tab1_Bro2.php','pop','scrollbars=yes,width=1100,height=300')"/>
</div></td>
</tr>
<tr>
<td colspan="6"><div align="center">
<input type="hidden" name="status" id="status" value="<?=$status?>" />
<input type="button" name="btnAdd" value="ตกลง" style="width:100px" onclick="JavaScript:doCallAjax(); return IsCheck('txtName','txtOther','txtSize','txtSize1','txtPage','txt1','txt2','txt3','txt4','txt5','txtComment');"/>
<!-- <input type="button" name="btnCancel" value="ยกเลิก" style="width:100px" onclick="JavaScript:onCancel();"/> -->
<input type="button" name="btnBack" value="กลับไปหน้าหลัก" style="width:100px" onclick="JavaScript:onBack();"/>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
Date :
2011-11-22 12:09:04
By :
tangsupap
ลองเอา doCallAjax() ;
ไว้ใน function IsCheck บันทัดที่ 187
เปลี่ยน return true เป็น doCallAjax() ;
แล้วก็เปลี่ยน onclick="JavaScript:doCallAjax();
เป็น onclick="JavaScript:IsCheck( ค่าตัวแปล1,ค่าตัวแปล2,...,ค่าตัวแปลN ); // ค่าตัวแปลตามที่คุณกำหนดไว้
Date :
2011-11-22 13:19:53
By :
ขนมหม้อแกง
ตอนนี้ได้ อยู่1ส่วนละครับ แต่ต้องเอา ทั้งหมดออกไปก่อนนะครับ ถึงจะทำได้ ผมทำผิดตรงใหน หรือครับ
Code (PHP)
var txtSizeFilter=/^([0-9]){1,}$/;
var txtSize=document.form1.txtSize.value;
if (!(txtSizeFilter.test(txtSize)))
{
alert ("ขนาดต้องป็นตัวเลข");
return false;
}
..
Date :
2011-11-22 14:54:29
By :
tangsupap
ลองก๊อบโค้ดด้านล่างไปลองรันดูครับ ว่าได้ไหม ?
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>รายการพิมพ์</title>
<script language="JavaScript">
var HttPRequest = false;
function doCallAjax() {
HttPRequest = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
HttPRequest = new XMLHttpRequest();
if (HttPRequest.overrideMimeType) {
HttPRequest.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!HttPRequest) {
alert('Cannot create XMLHTTP instance');
return false;
}
if(confirm('คุณต้องการเพิ่มข้อมูลใช่ไหม')==true)
{
var url = 'fn_formA1_tab1.php?txtCode='+document.getElementById("txtCode").value+'&txtDate='+document.getElementById("txtDate").value
+'&txtName='+document.getElementById("txtName").value+'&SelWork='+document.getElementById("SelWork").value+'&txtOther='+document.getElementById("txtOther").value
+'&txtSize='+document.getElementById("txtSize").value+'&txtSize1='+document.getElementById("txtSize1").value+'&SelSize='+document.getElementById("SelSize").value
+'&txtPage='+document.getElementById("txtPage").value+'&SelBook='+document.getElementById("SelBook").value+'&txt1='+document.getElementById("txt1").value
+'&txt2='+document.getElementById("txt2").value+'&txt3='+document.getElementById("txt3").value+'&txt4='+document.getElementById("txt4").value+'&txt5='+document.getElementById("txt5").value
+'&txtComment='+document.getElementById("txtComment").value+'&txtCus='+document.getElementById("txtCus").value+'&txtEmp='+document.getElementById("txtEmp").value
+'&status='+document.getElementById("status").value;
HttPRequest.open('POST',url,true);
HttPRequest.send(null);
}
HttPRequest.onreadystatechange = function()
{
if(HttPRequest.readyState == 4) // Return Request
{
document.getElementById("mySpan").innerHTML = HttPRequest.responseText;
}
}
/*
HttPRequest.onreadystatechange = call function .... // Call other function
*/
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features).focus();
}
function searchResultSaleman(theURL,winName,features) { //v2.0
window.open(theURL,winName,features).focus();
}
function searchResultSaleman(){
var width = 1100;
var height = 300;
var diaxFeature="dialogWidth:"+width+"px;"
+"dialogHeight:"+height+"px;"
/*+"dialogLeft:"+width+"px;"
+"dialogTop:"+width+"px;"*/
+"center:yes;"
+"edge:raised;" // sunken | raised
+"resizable:no;"
+"status:no;"
+"scroll:no;";
var returnValue = window.showModalDialog("formA1_tab1_Bro2.php","", diaxFeature);
//alert("value is : "+returnValue);
var myStr=new Array();
myStr = returnValue.split("-");
document.getElementById("txtEmp").value = myStr[0];
document.getElementById("txtEmp1").value = myStr[1];
}
function onCancel(){
window.location='';
}
function onBack(){
window.location='formA1.php';
}
function IsCheck(txtName, txtOther, txtSize, txtSize1, txtPage, txt1, txt2, txt3, txt4, txt5, txtComment)
{
//alert(eText);
if(document.getElementById(txtName).value == ''
&& document.getElementById(txtOther).value == ''
&& document.getElementById(txtSize).value == ''
&& document.getElementById(txtSize1).value == ''
&& document.getElementById(txtPage).value == ''
&& document.getElementById(txt1).value == ''
&& document.getElementById(txt2).value == ''
&& document.getElementById(txt3).value == ''
&& document.getElementById(txt4).value == ''
&& document.getElementById(txt5).value == ''
&& document.getElementById(txtComment).value == ''
)
{
alert('กรุณาใส่ข้อมูล');
return false;
}
else if(document.getElementById(txtName).value == ''
|| document.getElementById(txtOther).value == ''
|| document.getElementById(txtSize).value == ''
|| document.getElementById(txtSize1).value == ''
|| document.getElementById(txtPage).value == ''
|| document.getElementById(txt1).value == ''
|| document.getElementById(txt2).value == ''
|| document.getElementById(txt3).value == ''
|| document.getElementById(txt4).value == ''
|| document.getElementById(txt5).value == ''
|| document.getElementById(txtComment).value == ''
)
{
alert('กรุณาใส่ข้อมูลให้ครบ');
return false;
}
var txtSizeFilter=/^([0-9]){1,}$/;
var txtSize=document.form1.txtSize.value;
if (!(txtSizeFilter.test(txtSize)))
{
alert ("ขนาดต้องป็นตัวเลข");
return false;
}
var txtSize1Filter=/^([0-9]){1,}$/;
var txtSize1=document.form1.txtSize1.value;
if (!(txtSize1Filter.test(txtSize1)))
{
alert ("ขนาดต้องป็นตัวเลข");
return false;
}
var txtPageFilter=/^([0-9]){1,}$/;
var txtPage=document.form1.txtPage.value;
if (!(txtPageFilter.test(txtPage)))
{
alert ("จำนวนต้องป็นตัวเลข");
return false;
}
var txt1Filter=/^([0-9]){1,}$/;
var txt1=document.form1.txt1.value;
if (!(txt1Filter.test(txt1)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt2Filter=/^([0-9]){1,}$/;
var txt2=document.form1.txt2.value;
if (!(txt2Filter.test(txt2)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt3Filter=/^([0-9]){1,}$/;
var txt3=document.form1.txt3.value;
if (!(txt3Filter.test(txt3)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt4Filter=/^([0-9]){1,}$/;
var txt4=document.form1.txt4.value;
if (!(txt4Filter.test(txt4)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt5Filter=/^([0-9]){1,}$/;
var txt5=document.form1.txt5.value;
if (!(txt5Filter.test(txt5)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
else
//return true;
doCallAjax();
}
</script>
</head>
<body>
<form name="form1">
<span id="mySpan"></span>
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#0000FF">
<!--DWLayoutTable-->
<tr>
<td valign="top">
<table width="100%" border="1" align="center" bordercolor="#0099FF" bgcolor="#CCFFFF">
<tr>
<td width="128"><div align="right">เลขที่งาน :</div></td>
<td width="153"><div align="left">
<label>
<?=$LastID?>
<input type="hidden" name="txtCode" id="txtCode" disabled="disabled" value="<?=$LastID?>" />
</label>
</div></td>
<td width="142" colspan="3"><div align="right">วันที่ปรับปรุง :</div></td>
<td width="267"><div align="left">
<label>
<?=$CalDate?>
<input type="hidden" name="txtDate" id="txtDate" disabled="disabled" value="<?=$CalDate?>" />
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ชื่องาน :</div></td>
<td colspan="5"><div align="left">
<label>
<input name="txtName" id="txtName" type="text" size="100" value="<?=$JobName?>" />
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ลักษณะงาน :</div></td>
<td colspan="5"><div align="left">
<?php
echo "<label>";
$table_field1 = "JobTypeNo";
$table_field2 = "JobTypeName";
$strSQL= "SELECT JobTypeNo, JobTypeName FROM TBJobType";
$objConnect = mysql_connect($host,$user,$pass) or die("Error Connect to Database");
$objDB = mysql_select_db($db);
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
echo "<select name=\"SelWork\" id=\"SelWork\">";
while($row = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$row[$table_field1]?>" <? if($JobType != '' && $row[$table_field1] == $JobType){ echo "selected=\"selected\"";}?>><?=$row[$table_field2]?></option>
<?
}
echo "</select>";
echo "</label>";
?>
ระบุ
<label>
<input type="text" name="txtOther" id="txtOther" value="<?=$OthJobType?>" />
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ขนาด (กxย) :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txtSize" id="txtSize" value="<?=$PrdSizeW?>" />
</label>
x
<label>
<input type="text" name="txtSize1" id="txtSize1" value="<?=$PrdSizeH?>" />
</label>
<label>
<select name="SelSize" id="SelSize">
<option value="1" <? if($SizeID != '' && $SizeID == 1){ echo "selected=\"selected\"";}?>>นิ้ว</option>
<option value="2" <? if($SizeID != '' && $SizeID == 2){ echo "selected=\"selected\"";}?>>ซ.ม.</option>
</select>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">จำนวน :</div></td>
<td><div align="left">
<label>
<input name="txtPage" id="txtPage" type="text" size="10" value="<?=$QtyPage?>" />
</label>
หน้า
</div></td>
<td width="142"><div align="right">เข้าเล่ม :</div></td>
<td colspan="3"><div align="left">
<?php
echo "<label>";
require_once('connect.php');
$objConnect = mysql_connect($host,$user,$pass) or die("Error Connect to Database");
$objDB = mysql_select_db($db);
$table_field1 = "BindNo";
$table_field2 = "BindName";
$strSQL= "SELECT BindNo, BindName FROM TBBindType";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
echo "<select name=\"SelBook\" id=\"SelBook\">";
while($row = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$row[$table_field1]?>" <? if($BindType != '' && $row[$table_field1] == $BindType){ echo "selected=\"selected\"";}?>><?=$row[$table_field2]?></option>
<?
}
echo "</select>";
echo "</label>";
?>
</div></td>
</tr>
<tr>
<td><div align="right">ยอดพิมพ์ 1 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt1" id="txt1" value="<?=$QtyPrn1?>" />
</label>
<select name="unit1" id="unit1">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">2 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt2" id="txt2" value="<?=$QtyPrn2?>" />
</label>
<select name="unit2" id="unit2">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">3 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt3" id="txt3" value="<?=$QtyPrn3?>" />
</label>
<select name="unit3" id="unit3">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">4 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt4" id="txt4" value="<?=$QtyPrn4?>" />
</label>
<select name="unit4" id="unit4">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">5 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt5" id="txt5" value="<?=$QtyPrn5?>" />
</label>
<select name="unit5" id="unit5">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">หมายเหตุ :</div></td>
<td colspan="5"><div align="left">
<label>
<input name="txtComment" id="txtComment" type="text" size="100" value="<?=$JobRemark?>" />
</label>
<label></label>
</div></td>
</tr>
<tr>
<td><div align="right">ลูกค้า:</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txtCus" readonly="readonly" id="txtCus" value="<?=$CustID?>" />
<?
if($CustID != ''){
$strSQL = "SELECT company FROM TBcustomer WHERE CustID='$CustID'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);
$company=$objResult['company'];
}
?>
<input name="txtCus1" id="txtCus1" readonly="readonly" type="text" size="80" value="<?=$company?>" />
</label>
<label></label>
<label>
<input type="button" name="btnCus" value="Browes" style="width:100px" onclick="javascript:MM_openBrWindow('formA1_tab1_Bro1.php','pop','scrollbars=yes,width=1100,height=300')"/>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">พนักงานขาย :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txtEmp" id="txtEmp" readonly="readonly" value="<?=$SaleID?>" />
<?
if($SaleID != ''){
$strSQL = "SELECT FLName FROM TBsaleman WHERE SalemanID='$SaleID'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);
$FLName=$objResult['FLName'];
}
?>
<input name="txtEmp1" id="txtEmp1" readonly="readonly" type="text" size="80" value="<?=$FLName?>" />
</label>
<label></label>
<input type="button" name="btnEmp" value="Browes" style="width:100px" onclick="javascript:searchResultSaleman('formA1_tab1_Bro2.php','pop','scrollbars=yes,width=1100,height=300')"/>
</div></td>
</tr>
<tr>
<td colspan="6"><div align="center">
<input type="hidden" name="status" id="status" value="<?=$status?>" />
<input type="button" name="btnAdd" value="ตกลง" style="width:100px" onclick="JavaScript:return IsCheck('txtName','txtOther','txtSize','txtSize1','txtPage','txt1','txt2','txt3','txt4','txt5','txtComment');"/>
<!-- <input type="button" name="btnCancel" value="ยกเลิก" style="width:100px" onclick="JavaScript:onCancel();"/> -->
<input type="button" name="btnBack" value="กลับไปหน้าหลัก" style="width:100px" onclick="JavaScript:onBack();"/>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
Date :
2011-11-22 15:51:08
By :
ไวยวิทย์
ไม่ได้ อะครับผม
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>รายการพิมพ์</title>
<script language="JavaScript">
var HttPRequest = false;
function doCallAjax() {
HttPRequest = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
HttPRequest = new XMLHttpRequest();
if (HttPRequest.overrideMimeType) {
HttPRequest.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!HttPRequest) {
alert('Cannot create XMLHTTP instance');
return false;
}
if(confirm('คุณต้องการเพิ่มข้อมูลใช่ไหม')==true)
{
var url = 'fn_formA1_tab1.php?txtCode='+document.getElementById("txtCode").value+'&txtDate='+document.getElementById("txtDate").value
+'&txtName='+document.getElementById("txtName").value+'&SelWork='+document.getElementById("SelWork").value+'&txtOther='+document.getElementById("txtOther").value
+'&txtSize='+document.getElementById("txtSize").value+'&txtSize1='+document.getElementById("txtSize1").value+'&SelSize='+document.getElementById("SelSize").value
+'&txtPage='+document.getElementById("txtPage").value+'&SelBook='+document.getElementById("SelBook").value+'&txt1='+document.getElementById("txt1").value
+'&txt2='+document.getElementById("txt2").value+'&txt3='+document.getElementById("txt3").value+'&txt4='+document.getElementById("txt4").value+'&txt5='+document.getElementById("txt5").value
+'&txtComment='+document.getElementById("txtComment").value+'&txtCus='+document.getElementById("txtCus").value+'&txtEmp='+document.getElementById("txtEmp").value
+'&status='+document.getElementById("status").value;
HttPRequest.open('POST',url,true);
HttPRequest.send(null);
}
HttPRequest.onreadystatechange = function()
{
if(HttPRequest.readyState == 4) // Return Request
{
document.getElementById("mySpan").innerHTML = HttPRequest.responseText;
}
}
/*
HttPRequest.onreadystatechange = call function .... // Call other function
*/
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features).focus();
}
function searchResultSaleman(theURL,winName,features) { //v2.0
window.open(theURL,winName,features).focus();
}
function searchResultSaleman(){
var width = 1100;
var height = 300;
var diaxFeature="dialogWidth:"+width+"px;"
+"dialogHeight:"+height+"px;"
/*+"dialogLeft:"+width+"px;"
+"dialogTop:"+width+"px;"*/
+"center:yes;"
+"edge:raised;" // sunken | raised
+"resizable:no;"
+"status:no;"
+"scroll:no;";
var returnValue = window.showModalDialog("formA1_tab1_Bro2.php","", diaxFeature);
//alert("value is : "+returnValue);
var myStr=new Array();
myStr = returnValue.split("-");
document.getElementById("txtEmp").value = myStr[0];
document.getElementById("txtEmp1").value = myStr[1];
}
function onCancel(){
window.location='';
}
function onBack(){
window.location='formA1.php';
}
function IsCheck(txtName, txtOther, txtSize, txtSize1, txtPage, txt1, txt2, txt3, txt4, txt5, txtComment, txtCus, txtEmp)
{
//alert(eText);
if(document.getElementById(txtName).value == ''
&& document.getElementById(txtOther).value == ''
&& document.getElementById(txtSize).value == ''
&& document.getElementById(txtSize1).value == ''
&& document.getElementById(txtPage).value == ''
&& document.getElementById(txt1).value == ''
&& document.getElementById(txt2).value == ''
&& document.getElementById(txt3).value == ''
&& document.getElementById(txt4).value == ''
&& document.getElementById(txt5).value == ''
&& document.getElementById(txtComment).value == ''
&& document.getElementById(txtCus).value == ''
&& document.getElementById(txtEmp).value == ''
)
{
alert('กรุณาใส่ข้อมูล');
return false;
}
else if(document.getElementById(txtName).value == ''
|| document.getElementById(txtOther).value == ''
|| document.getElementById(txtSize).value == ''
|| document.getElementById(txtSize1).value == ''
|| document.getElementById(txtPage).value == ''
|| document.getElementById(txt1).value == ''
|| document.getElementById(txt2).value == ''
|| document.getElementById(txt3).value == ''
|| document.getElementById(txt4).value == ''
|| document.getElementById(txt5).value == ''
|| document.getElementById(txtComment).value == ''
|| document.getElementById(txtCus).value == ''
|| document.getElementById(txtEmp).value == ''
)
{
alert('กรุณาใส่ข้อมูลให้ครบ');
return false;
}
var txtSizeFilter=/^([0-9]){1,}$/;
var txtSize=document.form1.txtSize.value;
if (!(txtSizeFilter.test(txtSize)))
{
alert ("ขนาดต้องป็นตัวเลข");
return false;
}
var txtSize1Filter=/^([0-9]){1,}$/;
var txtSize1=document.form1.txtSize1.value;
if (!(txtSize1Filter.test(txtSize1)))
{
alert ("ขนาดต้องป็นตัวเลข");
return false;
}
var txtPageFilter=/^([0-9]){1,}$/;
var txtPage=document.form1.txtPage.value;
if (!(txtPageFilter.test(txtPage)))
{
alert ("จำนวนต้องป็นตัวเลข");
return false;
}
var txt1Filter=/^([0-9]){1,}$/;
var txt1=document.form1.txt1.value;
if (!(txt1Filter.test(txt1)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt2Filter=/^([0-9]){1,}$/;
var txt2=document.form1.txt2.value;
if (!(txt2Filter.test(txt2)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt3Filter=/^([0-9]){1,}$/;
var txt3=document.form1.txt3.value;
if (!(txt3Filter.test(txt3)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt4Filter=/^([0-9]){1,}$/;
var txt4=document.form1.txt4.value;
if (!(txt4Filter.test(txt4)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
var txt5Filter=/^([0-9]){1,}$/;
var txt5=document.form1.txt5.value;
if (!(txt5Filter.test(txt5)))
{
alert ("ยอดพิมพ์ต้องป็นตัวเลข");
return false;
}
else
doCallAjax();
}
</script>
</head>
<body>
<form name="form1">
<span id="mySpan"></span>
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#0000FF">
<!--DWLayoutTable-->
<tr>
<td valign="top">
<table width="100%" border="1" align="center" bordercolor="#0099FF" bgcolor="#CCFFFF">
<tr>
<td width="128"><div align="right">เลขที่งาน :</div></td>
<td width="153"><div align="left">
<label>
<?=$LastID?>
<input type="hidden" name="txtCode" id="txtCode" disabled="disabled" value="<?=$LastID?>" />
</label>
</div></td>
<td width="142" colspan="3"><div align="right">วันที่ปรับปรุง :</div></td>
<td width="267"><div align="left">
<label>
<?=$CalDate?>
<input type="hidden" name="txtDate" id="txtDate" disabled="disabled" value="<?=$CalDate?>" />
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ชื่องาน :</div></td>
<td colspan="5"><div align="left">
<label>
<input name="txtName" id="txtName" type="text" size="100" value="<?=$JobName?>" />
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ลักษณะงาน :</div></td>
<td colspan="5"><div align="left">
<?php
echo "<label>";
$table_field1 = "JobTypeNo";
$table_field2 = "JobTypeName";
$strSQL= "SELECT JobTypeNo, JobTypeName FROM TBJobType";
$objConnect = mysql_connect($host,$user,$pass) or die("Error Connect to Database");
$objDB = mysql_select_db($db);
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
echo "<select name=\"SelWork\" id=\"SelWork\">";
while($row = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$row[$table_field1]?>" <? if($JobType != '' && $row[$table_field1] == $JobType){ echo "selected=\"selected\"";}?>><?=$row[$table_field2]?></option>
<?
}
echo "</select>";
echo "</label>";
?>
ระบุ
<label>
<input type="text" name="txtOther" id="txtOther" value="<?=$OthJobType?>" />
</label>
</div></td>
</tr>
<tr>
<td><div align="right">ขนาด (กxย) :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txtSize" id="txtSize" value="<?=$PrdSizeW?>" />
</label>
x
<label>
<input type="text" name="txtSize1" id="txtSize1" value="<?=$PrdSizeH?>" />
</label>
<label>
<select name="SelSize" id="SelSize">
<option value="1" <? if($SizeID != '' && $SizeID == 1){ echo "selected=\"selected\"";}?>>นิ้ว</option>
<option value="2" <? if($SizeID != '' && $SizeID == 2){ echo "selected=\"selected\"";}?>>ซ.ม.</option>
</select>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">จำนวน :</div></td>
<td><div align="left">
<label>
<input name="txtPage" id="txtPage" type="text" size="10" value="<?=$QtyPage?>" />
</label>
หน้า
</div></td>
<td width="142"><div align="right">เข้าเล่ม :</div></td>
<td colspan="3"><div align="left">
<?php
echo "<label>";
require_once('connect.php');
$objConnect = mysql_connect($host,$user,$pass) or die("Error Connect to Database");
$objDB = mysql_select_db($db);
$table_field1 = "BindNo";
$table_field2 = "BindName";
$strSQL= "SELECT BindNo, BindName FROM TBBindType";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
echo "<select name=\"SelBook\" id=\"SelBook\">";
while($row = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$row[$table_field1]?>" <? if($BindType != '' && $row[$table_field1] == $BindType){ echo "selected=\"selected\"";}?>><?=$row[$table_field2]?></option>
<?
}
echo "</select>";
echo "</label>";
?>
</div></td>
</tr>
<tr>
<td><div align="right">ยอดพิมพ์ 1 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt1" id="txt1" value="<?=$QtyPrn1?>" />
</label>
<select name="unit1" id="unit1">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">2 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt2" id="txt2" value="<?=$QtyPrn2?>" />
</label>
<select name="unit2" id="unit2">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">3 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt3" id="txt3" value="<?=$QtyPrn3?>" />
</label>
<select name="unit3" id="unit3">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">4 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt4" id="txt4" value="<?=$QtyPrn4?>" />
</label>
<select name="unit4" id="unit4">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">5 :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txt5" id="txt5" value="<?=$QtyPrn5?>" />
</label>
<select name="unit5" id="unit5">
<option value="1">ใบพิมพ์</option>
<option value="2">ใบเล็ก</option>
<option value="5">ใบ</option>
<option value="3">เล่ม</option>
<option value="4">หน่วย</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">หมายเหตุ :</div></td>
<td colspan="5"><div align="left">
<label>
<input name="txtComment" id="txtComment" type="text" size="100" value="<?=$JobRemark?>" />
</label>
<label></label>
</div></td>
</tr>
<tr>
<td><div align="right">ลูกค้า:</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txtCus" readonly="readonly" id="txtCus" value="<?=$CustID?>" />
<?
if($CustID != ''){
$strSQL = "SELECT company FROM TBcustomer WHERE CustID='$CustID'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);
$company=$objResult['company'];
}
?>
<input name="txtCus1" id="txtCus1" readonly="readonly" type="text" size="80" value="<?=$company?>" />
</label>
<label></label>
<label>
<input type="button" name="btnCus" value="Browes" style="width:100px" onclick="javascript:MM_openBrWindow('formA1_tab1_Bro1.php','pop','scrollbars=yes,width=1100,height=300')"/>
</label>
</div></td>
</tr>
<tr>
<td><div align="right">พนักงานขาย :</div></td>
<td colspan="5"><div align="left">
<label>
<input type="text" name="txtEmp" id="txtEmp" readonly="readonly" value="<?=$SaleID?>" />
<?
if($SaleID != ''){
$strSQL = "SELECT FLName FROM TBsaleman WHERE SalemanID='$SaleID'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);
$FLName=$objResult['FLName'];
}
?>
<input name="txtEmp1" id="txtEmp1" readonly="readonly" type="text" size="80" value="<?=$FLName?>" />
</label>
<label></label>
<input type="button" name="btnEmp" value="Browes" style="width:100px" onclick="javascript:searchResultSaleman('formA1_tab1_Bro2.php','pop','scrollbars=yes,width=1100,height=300')"/>
</div></td>
</tr>
<tr>
<td colspan="6"><div align="center">
<input type="hidden" name="status" id="status" value="<?=$status?>" />
<input type="button" name="btnAdd" value="ตกลง" style="width:100px" onclick="JavaScript:IsCheck('txtName','txtOther','txtSize','txtSize1','txtPage','txt1','txt2','txt3','txt4','txt5','txtComment','txtCus','txtEmp');"/>
<!-- <input type="button" name="btnCancel" value="ยกเลิก" style="width:100px" onclick="JavaScript:onCancel();"/> -->
<input type="button" name="btnBack" value="กลับไปหน้าหลัก" style="width:100px" onclick="JavaScript:onBack();"/>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
Date :
2011-11-22 16:02:37
By :
tangsupap
แต่พอเอา
Code (PHP)
var txtSizeFilter=/^([0-9]){1,}$/;
var txtSize=document.form1.txtSize.value;
if (!(txtSizeFilter.test(txtSize)))
{
alert ("ขนาดต้องป็นตัวเลข");
return false;
}
ออกทั่งหมด สามารถทำงานได้ อะครับ
Date :
2011-11-22 16:03:39
By :
tangsupap
Load balance : Server 05