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 > รบกวนด้วยคะ ทำการ Search แบบส่งค่า window.open('getData.php?Code='+document.getElementById('Code').value แล้วส่งค่ากลับไม่ได้นะคะ มันขึ้น Error: null is null or not an object



 

รบกวนด้วยคะ ทำการ Search แบบส่งค่า window.open('getData.php?Code='+document.getElementById('Code').value แล้วส่งค่ากลับไม่ได้นะคะ มันขึ้น Error: null is null or not an object

 



Topic : 106916



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



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




รบกวนด้วยคะ ทำการ Search แบบส่งค่า window.open('getData.php?Code='+document.getElementById('Code').value แล้วส่งค่ากลับไม่ได้นะคะ มันขึ้น Error: null is null or not an object คะ

อันนี้ Code ส่งค่ากลับของหนูคะ ไม่รู้ผิดตรงไหนคะ รบกวนแนะนำด้วยคะ
Code (PHP)
<?php
include("connect.php");


?>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" />
<title></title>
</head>
<script language="javascript">
	function selData(CODE,NAME)
	{
		var sCODE = self.opener.document.getElementById("txtCODE");
		sCODE.value = CODE;

		var sNAME = self.opener.document.getElementById("txtNAME);
		sNAME.value = NAME;

		window.close();
	}
</script>
<body>
<?

$Code= $_GET['Code'];
$strSQL = "SELECT * from user  where Code = '$Code'";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="600" border="1">
  <tr>
    <th> <div align="center">ชื่อ</div></th>
  </tr>
<?
	while($objResult = mysql_fetch_array($objQuery))
{
?>
  <tr>
    <td><div align="center"><a href="#" OnClick="selData('<?=$objResult["CODE"];?>','<?=$objResult["NAME"];?>');">
	<?=$objResult["NAME"];?>
	</a></div></td>
  </tr>




Tag : PHP, MySQL, JavaScript







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2014-03-14 22:29:45 By : pinkie View : 915 Reply : 8
 

 

No. 1



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



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

ผมไม่เห็น input id="Code" นะ o.O






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-03-14 22:45:12 By : itpcc
 


 

No. 2



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



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


อันนี้หน้า form คะ
Code (PHP)
<?php
include("connect.php");
?>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" />
<title></title>
</head>

<script language="javascript">

	function OpenPopup(intLine)
	{
			window.open('getData.php?Code='+document.getElementById('txtCode').value,'myPopup','width=750,height=500,toolbar=0, menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');
	}

		function CreateNewRow()
	{
		var intLine = parseInt(document.frmMain.hdnMaxLine.value);
		intLine++;
			
		var theTable = document.getElementById("tbExp");
		var newRow = theTable.insertRow(theTable.rows.length)
		newRow.id = newRow.uniqueID

		var newCell
		
		//*** Column No ***//
		newCell = newRow.insertCell(0);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center>"+intLine+"</center>";

		//*** Column Code ***//
		newCell = newRow.insertCell(1);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"txtCode[]"+intLine+"\"  ID=\"txtCode"+intLine+"\" VALUE=\"\" +intLine+"\"></center>";

				//*** Column Code ***//
		newCell = newRow.insertCell(2);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		newCell.innerHTML = "<center><INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"txtName[]"+intLine+"\"  ID=\"txtName"+intLine+"\" VALUE=\"\" +intLine+"\"></center>";

				//*** Column  ***//
		newCell = newRow.insertCell(3);
		newCell.id = newCell.uniqueID;
		newCell.setAttribute("className", "css-name");
		//newCell.setAttribute("OnClick", "OpenPopup('"+intLine+"')");
		newCell.innerHTML = "<center><INPUT TYPE=\"BUTTON\" NAME=\"btnPopup_"+intLine+"\"  ID=\"btnPopup_"+intLine+"\" VALUE=\"..\" OnClick=\"OpenPopup('"+intLine+"')\"></center>";	

		document.frmMain.hdnMaxLine.value = intLine;
	}

	function RemoveRow()
	{
		intLine = parseInt(document.frmMain.hdnMaxLine.value);
		if(parseInt(intLine) > 0)
		{
				theTable = document.getElementById("tbExp");				
				theTableBody = theTable.tBodies[0];
				theTableBody.deleteRow(intLine);
				intLine--;
				document.frmMain.hdnMaxLine.value = intLine;
		}	
	}	

	</script>
<form name="frmMain" method="post"  action="<?=$_SERVER['SCRIPT_NAME'];?>">

		<table width="50%" border="0" id="tbExp"  action="Readdata4">
		  <tr align="center" >
			<td><b>No</b></td>
			<td><b>Code</b></td>
			<td><b>Name</b></td>
			<td><b></b></td>
		  </tr>
		</table>
		<div align="center">
		</div>
			<p>
					<input type="hidden" name="hdnMaxLine" value="0">
					<input name="btnAdd" type="button" id="btnAdd" value="+" onClick="CreateNewRow();">
					<input name="btnDel" type="button" id="btnDel" value="-" onClick="RemoveRow();">
                </table>
				<p></p>
				<div align="center">
						<input type="hidden" name="form"/>
						<input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />
						<input type="reset" name="Reset" id="button" value="cancel" />
				</div>
                </table>
				</form>	



ประวัติการแก้ไข
2014-03-14 23:15:19
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-03-14 22:56:48 By : pinkie
 

 

No. 3



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



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

ยืนยันคำเดิมครับ
ผมไม่เห็น input id="txtCode" นะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-03-14 23:01:50 By : itpcc
 


 

No. 4



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



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


บรรทัดที่ 38 คะ หนูอยากให้มันส่งค่ามาใส่ textbox สองอันนี้คะ พอคลิกที่ปุ่ม popup มันจะส่งค่าไป Search ใน file getdata.php พอได้ค่าแล้ว seldata มันไม่ส่งค่ามาอะคะ หนูไม่เก่งนะคะ ไม่รู้จะอธิบายพี่เข้าใจหรือเปล่า
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-03-14 23:38:08 By : pinkie
 


 

No. 5



โพสกระทู้ ( 5,105 )
บทความ ( 4 )

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

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


ตอบความคิดเห็นที่ : 3 เขียนโดย : itpcc เมื่อวันที่ 2014-03-14 23:01:50
รายละเอียดของการตอบ ::
ลองไปแก้ ตามคำแนะนำนี่ยังครับ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-03-15 10:37:55 By : apisitp
 


 

No. 6



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



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

ตอบความคิดเห็นที่ : 4 เขียนโดย : pinkie เมื่อวันที่ 2014-03-14 23:38:08
รายละเอียดของการตอบ ::
ยืนยันคำเดิมครับ
ผมไม่เห็น input id="txtCode" นะ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-03-15 11:55:39 By : itpcc
 


 

No. 7



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



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


ไม่เป็นไรคะ ขอบคุณคะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-03-15 15:12:07 By : pinkie
 


 

No. 8



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



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

ตอบความคิดเห็นที่ : 7 เขียนโดย : pinkie เมื่อวันที่ 2014-03-15 15:12:07
รายละเอียดของการตอบ ::
ไม่เป็นไรครับ
ใบ้นิดนึง ทำไมรับค่า intLine แล้วจำตอนเขียน Code เพิ่มบรรทัดของน้องได้มั้ยว่า intLine มันใช้ตรงไหน

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-03-15 15:20:20 By : itpcc
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : รบกวนด้วยคะ ทำการ Search แบบส่งค่า window.open('getData.php?Code='+document.getElementById('Code').value แล้วส่งค่ากลับไม่ได้นะคะ มันขึ้น Error: null is null or not an object
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 อัตราราคา คลิกที่นี่