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,027

HOME > PHP > PHP Forum > ผมใช้การเช็กการใส่ข้อมูล ให้มันเช็กใส่ขอมูลเฉพาะตัวเลขไม่ได้ อะครับ ผิดตรงใหน หรือครับ



 

ผมใช้การเช็กการใส่ข้อมูล ให้มันเช็กใส่ขอมูลเฉพาะตัวเลขไม่ได้ อะครับ ผิดตรงใหน หรือครับ

 



Topic : 069406



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



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




ตอนนี้ เช็กให้ใส่ข้อมูลครบได้แล้ว ตามนี้ครับ
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;
		}
		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">เลขที่งาน&nbsp;&nbsp;:</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">วันที่ปรับปรุง&nbsp;:</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">ชื่องาน &nbsp;:</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">ลักษณะงาน &nbsp;:</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ย) &nbsp;:</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">จำนวน&nbsp;:</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">เข้าเล่ม&nbsp;&nbsp;:</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">ยอดพิมพ์&nbsp;&nbsp;1&nbsp;:</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&nbsp;:</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&nbsp;:</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&nbsp;:</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&nbsp;:</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">หมายเหตุ&nbsp;:</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">พนักงานขาย&nbsp;:</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');"/>&nbsp;
             <!-- <input type="button" name="btnCancel" value="ยกเลิก" style="width:100px" onclick="JavaScript:onCancel();"/>&nbsp;-->
              <input type="button" name="btnBack" value="กลับไปหน้าหลัก" style="width:100px" onclick="JavaScript:onBack();"/>
            </div></td>
          </tr>
        </table>
    </td>
  </tr>  
</table>
</form>
</body>
</html>


แต่พอมีการเพิ่มการเช็กให้ใส่ได้ เฉพาะตัวเลข ก้ไม่สามารถทำงานได้ครับ ต้องแก้ตรงใหนหรือครับ ตามนี้ ครับ
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">เลขที่งาน&nbsp;&nbsp;:</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">วันที่ปรับปรุง&nbsp;:</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">ชื่องาน &nbsp;:</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">ลักษณะงาน &nbsp;:</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ย) &nbsp;:</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">จำนวน&nbsp;:</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">เข้าเล่ม&nbsp;&nbsp;:</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">ยอดพิมพ์&nbsp;&nbsp;1&nbsp;:</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&nbsp;:</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&nbsp;:</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&nbsp;:</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&nbsp;:</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">หมายเหตุ&nbsp;:</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">พนักงานขาย&nbsp;:</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');"/>&nbsp;
             <!-- <input type="button" name="btnCancel" value="ยกเลิก" style="width:100px" onclick="JavaScript:onCancel();"/>&nbsp;-->
              <input type="button" name="btnBack" value="กลับไปหน้าหลัก" style="width:100px" onclick="JavaScript:onBack();"/>
            </div></td>
          </tr>
        </table>
    </td>
  </tr>  
</table>
</form>
</body>
</html>




Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-11-22 15:56:35 By : tangsupap View : 792 Reply : 2
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

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

ยาวขนาดนี้จะช่วยดูยังไงดีครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-11-22 18:05:44 By : webmaster
 


 

No. 2



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



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


ตรงบรรทัด 87-192 อะครับ ผมงง จริงๆ ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-11-22 18:26:12 By : tangsupap
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
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 02
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 อัตราราคา คลิกที่นี่