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 > การแสดง Listmenu ตามจำนวนแถวที่ได้ระบุค่า แล้วให้แสดง Listmenu ทุกแถว



 

การแสดง Listmenu ตามจำนวนแถวที่ได้ระบุค่า แล้วให้แสดง Listmenu ทุกแถว

 



Topic : 075375



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



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




Code (PHP)
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=tis-620">
<meta http-equiv="Content-Type" content="text/html; charset=windows-874"> 
<title></title>
<script type="text/javascript" src="editor/tinymce/tiny_mce.js"></script>
<script type="text/javascript" src="editor/tinymce/editor.js"></script>
<?
     $objConnect = mysql_connect("localhost","root","111") or die("Error Connect to Database");
	$objDB = mysql_select_db("nsonews");
	//@mysql_query("SET NAMES UTF8");?>
	<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<script language = "JavaScript">
		//**** List node (Start) ***//
		function Listnode(SelectValue)
		{
			frmMain.ddlnode.length = 0
			frmMain.ddlsubnode.length = 0
			//*** Insert null Default Value ***//
			var myOption = new Option('','')  
			frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption
			<?
			$intRows = 0;
			$strSQL = "SELECT * FROM node  ORDER BY nodeid ASC ";
			$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
			$intRows = 0;
			while($objResult = mysql_fetch_array($objQuery))
			{
			$intRows++;
			?>			
				x = <?=$intRows;?>;
				mySubList = new Array();
				
				strGroup = <?=$objResult["dsubjectid"];?>;
				strValue = "<?=$objResult["nodeid"];?>";
				strItem = "<?=$objResult["nodename"];?>";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
			<?
			}
			?>																	
		}
		//**** List node (End) ***//
		//**** List subnode (Start) ***//
		function Listsubnode(SelectValue)
		{
			frmMain.ddlsubnode.length = 0
			//*** Insert null Default Value ***//
			var myOption = new Option('','')  
			frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption
			<?
			$intRows = 0;
			$strSQL = "SELECT * FROM subnode ORDER BY subnodeid ASC ";
			$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
			$intRows = 0;
			while($objResult = mysql_fetch_array($objQuery))
			{
			$intRows++;
			?>
				x = <?=$intRows;?>;
				mySubList = new Array();
				
				strGroup = <?=$objResult["nodeid"];?>;
				strValue = "<?=$objResult["subnodeid"];?>";
				strItem = "<?=$objResult["subnodename"];?>";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
			<?
			}
			?>																	
		}
		//**** L (End) ***//

</script>

      <style type="text/css" media="screen">
      body { padding:20px;}
      </style>
<style type="text/css">
<!--
.style13 {font-size: 10px}
.style14 {
	color: #0000FF;
	font-weight: bold;
}
.style19 {font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 14px; }
-->
</style>



</head>
<body>
<?
 require("include/config.php");
 require("include/opendb.php");
?>
<form name="frmMain" method="post" action="">
<table width="100%" border="1">
 <tr>
  Line : 
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<?
for($i=1;$i<=50;$i++)
{
	if($_GET["Line"] == $i)
	{
		$sel = "selected";
	}
	else
	{
		$sel = "";
	}
?>
	<option value="<?=$_SERVER["PHP_SELF"];?>?Line=<?=$i;?>" <?=$sel;?>><?=$i;?></option>
<?
}
?>
</select>
<?
  $line = $_GET["Line"];
  if($line == 0)
  {
	  $line=1;
	  }
  for($i=1;$i<=$line;$i++)
  {
  ?>
    <td><span class="style19">ʶҹ¡Òóì</span></td>
    <td>dsubject
	<select id="ddldsub" name="ddldsub" onChange = "Listnode(this.value)">
	<option selected value="">--àÅ×Í¡--</option>
	<?
	$strSQL = "SELECT * FROM dsubject ORDER BY dsubjectid ASC ";
	$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
	while($objResult = mysql_fetch_array($objQuery))
	{
	?>
	<option value="<?=$objResult["dsubjectid"];?>"><?=$objResult["dsubjectname"];?></option>
	<?
	}
	$did = $objResult["dsubjectid"] ; 
	//echo "$did" ;
	echo "$ddlnode(this.value)";
	?>
	</select>
	node
	<select id="ddlnode" name="ddlnode" style="width:120px" onChange = "Listsubnode(this.value)">
	</select>
   subnode
	<select id="ddlsubnode" name="ddlsubnode" style="width:200px"></select>
	</td>
    <td>&nbsp;</td>
  </tr>
 <?
  }	
?>
</table>
</form> 
</body>
</html>



จาก โค้ดถ้าเลือก 1 line listmenu จะทำงาน
แต่ถ้ามากกว่า 1 line listmenu จะไม่ทำงานครับ คือเมื่อเลือก list ตัวที่1 list ตัวที่2 ไม่ทำงานคือไม่มีค่าอสดงในลิสต์
ช่วยหน่อยนะครับ



Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-03-12 10:05:25 By : kung1451 View : 976 Reply : 4
 

 

No. 1



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

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

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

View Source ในหน้า IE มาให้ดูหน่อยครับ จะได้ ลองดู






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-13 06:40:36 By : webmaster
 


 

No. 2



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



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


<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=tis-620">
<meta http-equiv="Content-Type" content="text/html; charset=windows-874"> 
<title></title>
 
 
<script language="JavaScript" type="text/JavaScript"> 
<!--
function MM_jumpMenu(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<script language = "JavaScript"> 
		//**** List node (Start) ***//
		function Listnode(SelectValue)
		{
			frmMain.ddlnode.length = 0
			frmMain.ddlsubnode.length = 0
			//*** Insert null Default Value ***//
			var myOption = new Option('','')  
			frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption
						
				x = 1;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "01";
				strItem = "ข้อมูลเกี่ยวกับน้ำ / ปริมาณฝน / พายุ ฯลฯ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 2;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "02";
				strItem = "การป้องกันน้ำท่วม / การเตือนภัย / ประตูกั้นน้ำ / แนวคันกั้นน้ำ ฯลฯ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 3;
				mySubList = new Array();
				
				strGroup = 02;
				strValue = "02";
				strItem = "22hhh";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 4;
				mySubList = new Array();
				
				strGroup = 03;
				strValue = "03";
				strItem = "333ggg";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 5;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "03";
				strItem = "ข้อมูลพื้นที่น้ำท่วม";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 6;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "04";
				strItem = "ข้อมูลผู้ประสบภัย";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 7;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "05";
				strItem = "การช่วยเหลือน้ำท่วม / ข้อมูลความช่วยเหลือ / หน่วยงาน / มาตรการการช่วยเหลือ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 8;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "06";
				strItem = "ข้อมูลศูนย์พักพิง/ศูนย์อพยพ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 9;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "07";
				strItem = "ข้อมูลสินค้าอุปโภค/บริโภค/การกระจายสินค้า/ราคา";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 10;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "08";
				strItem = "ผลกระทบด้านเศรษฐกิจและสังคม";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
						
				x = 11;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "09";
				strItem = "อื่นๆ เช่น ขยะ น้ำเน่าเสีย ฯลฯ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlnode.options[frmMain.ddlnode.length]= myOption					
				}
																				
		}
		//**** List node (End) ***//
		//**** List subnode (Start) ***//
		function Listsubnode(SelectValue)
		{
			frmMain.ddlsubnode.length = 0
			//*** Insert null Default Value ***//
			var myOption = new Option('','')  
			frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption
							x = 1;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "01";
				strItem = "ปริมาณน้ำในเขื่อน/อ่างเก็บน้ำทั้งหมด";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 2;
				mySubList = new Array();
				
				strGroup = 04;
				strValue = "01";
				strItem = "จำนวนคน/ครัวเรือนประสบภัย";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 3;
				mySubList = new Array();
				
				strGroup = 03;
				strValue = "01";
				strItem = "พื้นที่น้ำท่วม (แห่ง/พื้นที่กว้าง)";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 4;
				mySubList = new Array();
				
				strGroup = 02;
				strValue = "01";
				strItem = "ระดับความสูงของพื้นที่";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 5;
				mySubList = new Array();
				
				strGroup = 04;
				strValue = "02";
				strItem = "จำนวนคน/ครัวเรือนที่ยังพักอาศัยในพื้นที่ประสบภัย";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 6;
				mySubList = new Array();
				
				strGroup = 03;
				strValue = "02";
				strItem = "ระดับความลึกของน้ำที่ท่วม (ในถนน ตรอก ซอย)";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 7;
				mySubList = new Array();
				
				strGroup = 02;
				strValue = "02";
				strItem = "222lll";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 8;
				mySubList = new Array();
				
				strGroup = 02;
				strValue = "02";
				strItem = "พื้นที่เสี่ยงภัยน้ำท่วม";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 9;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "02";
				strItem = "ปริมาณน้ำไหลเข้าอ่าง";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 10;
				mySubList = new Array();
				
				strGroup = 03;
				strValue = "03";
				strItem = "การเพิ่ม/ลดของระดับน้ำที่ท่วม";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 11;
				mySubList = new Array();
				
				strGroup = 04;
				strValue = "03";
				strItem = "จำนวนผู้ประสบภัยที่ต้องการความช่วยเหลือเป็นพิเศษ (เด็กเล็ก คนชรา คนป่วย คนท้อง)";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 12;
				mySubList = new Array();
				
				strGroup = 02;
				strValue = "03";
				strItem = "ประตูกั้นน้ำ/แนวคันกั้นน้ำ (การสร้าง/การเปิดระบายน้ำ/การพังทลาย)";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 13;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "03";
				strItem = "ปริมาณการระบายออกจากเขื่อน/อัตราการปล่อยน้ำ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 14;
				mySubList = new Array();
				
				strGroup = 03;
				strValue = "04";
				strItem = "ระยะเวลาที่น้ำท่วม";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 15;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "04";
				strItem = "ปริมาณน้ำฝน";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 16;
				mySubList = new Array();
				
				strGroup = 04;
				strValue = "04";
				strItem = "จำนวนสถานประกอบการที่ได้รับผลกระทบ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 17;
				mySubList = new Array();
				
				strGroup = 02;
				strValue = "04";
				strItem = "คลองระบายน้ำ/ปริมาณน้ำในคลอง/ปริมาณน้ำที่รับได้";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 18;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "05";
				strItem = "ระดับน้ำทะเลหนุน";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 19;
				mySubList = new Array();
				
				strGroup = 02;
				strValue = "05";
				strItem = "เส้นทางการระบายน้ำ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 20;
				mySubList = new Array();
				
				strGroup = 04;
				strValue = "05";
				strItem = "จำนวนหน่วยงานราชการ/โรงพยาบาล/โรงเรียนที่ประสบภัย";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 21;
				mySubList = new Array();
				
				strGroup = 03;
				strValue = "05";
				strItem = "การระบายน้ำจากพื้นที่น้ำท่วม";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 22;
				mySubList = new Array();
				
				strGroup = 03;
				strValue = "06";
				strItem = "เส้นทางการคมนาคมที่เสียหาย/ปิดเส้นทาง";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 23;
				mySubList = new Array();
				
				strGroup = 02;
				strValue = "06";
				strItem = "การแจ้งเตือนภัยพื้นที่เสี่ยง/พื้นที่เฝ้าระวัง/พื้นที่อพยพ ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 24;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "06";
				strItem = "ปริมาณน้ำที่ท่วม (มวลน้ำ)";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 25;
				mySubList = new Array();
				
				strGroup = 03;
				strValue = "07";
				strItem = "ความเสียหายที่เกิดจากน้ำท่วม (ทรัพย์สิน  ชีวิต (จำนวนผู้เสียชีวิต/สูญหาย) พื้นที่การเกษตร)";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 26;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "07";
				strItem = "อัตราการไหลของน้ำ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 27;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "08";
				strItem = "ข้อมูลเกี่ยวกับพายุ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 28;
				mySubList = new Array();
				
				strGroup = 04;
				strValue = "09";
				strItem = "อื่นๆ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 29;
				mySubList = new Array();
				
				strGroup = 03;
				strValue = "09";
				strItem = "อื่นๆ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 30;
				mySubList = new Array();
				
				strGroup = 01;
				strValue = "09";
				strItem = "อื่นๆ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
							x = 31;
				mySubList = new Array();
				
				strGroup = 02;
				strValue = "09";
				strItem = "อื่นๆ";
				mySubList[x,0] = strItem;
				mySubList[x,1] = strGroup;
				mySubList[x,2] = strValue;
							
				if (mySubList[x,1] == SelectValue){
					var myOption = new Option(mySubList[x,0], mySubList[x,2])  
					frmMain.ddlsubnode.options[frmMain.ddlsubnode.length]= myOption					
				}
																				
		}
		//**** L (End) ***//
 
</script>
 
</head>
<body>
 
 
 
 
 
 
<form name="frmMain" method="post" action="">
<table width="100%" border="1">
 <tr>
  Line : 
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
	<option value="/news_system/t4.php?Line=1" selected>1</option>
	<option value="/news_system/t4.php?Line=2" >2</option>
	<option value="/news_system/t4.php?Line=3" >3</option>
	<option value="/news_system/t4.php?Line=4" >4</option>
	<option value="/news_system/t4.php?Line=5" >5</option>
	<option value="/news_system/t4.php?Line=6" >6</option>
	<option value="/news_system/t4.php?Line=7" >7</option>
	<option value="/news_system/t4.php?Line=8" >8</option>
	<option value="/news_system/t4.php?Line=9" >9</option>
	<option value="/news_system/t4.php?Line=10" >10</option>
	<option value="/news_system/t4.php?Line=11" >11</option>
	<option value="/news_system/t4.php?Line=12" >12</option>
	<option value="/news_system/t4.php?Line=13" >13</option>
	<option value="/news_system/t4.php?Line=14" >14</option>
	<option value="/news_system/t4.php?Line=15" >15</option>
	<option value="/news_system/t4.php?Line=16" >16</option>
	<option value="/news_system/t4.php?Line=17" >17</option>
	<option value="/news_system/t4.php?Line=18" >18</option>
	<option value="/news_system/t4.php?Line=19" >19</option>
	<option value="/news_system/t4.php?Line=20" >20</option>
	<option value="/news_system/t4.php?Line=21" >21</option>
	<option value="/news_system/t4.php?Line=22" >22</option>
	<option value="/news_system/t4.php?Line=23" >23</option>
	<option value="/news_system/t4.php?Line=24" >24</option>
	<option value="/news_system/t4.php?Line=25" >25</option>
	<option value="/news_system/t4.php?Line=26" >26</option>
	<option value="/news_system/t4.php?Line=27" >27</option>
	<option value="/news_system/t4.php?Line=28" >28</option>
	<option value="/news_system/t4.php?Line=29" >29</option>
	<option value="/news_system/t4.php?Line=30" >30</option>
	<option value="/news_system/t4.php?Line=31" >31</option>
	<option value="/news_system/t4.php?Line=32" >32</option>
	<option value="/news_system/t4.php?Line=33" >33</option>
	<option value="/news_system/t4.php?Line=34" >34</option>
	<option value="/news_system/t4.php?Line=35" >35</option>
	<option value="/news_system/t4.php?Line=36" >36</option>
	<option value="/news_system/t4.php?Line=37" >37</option>
	<option value="/news_system/t4.php?Line=38" >38</option>
	<option value="/news_system/t4.php?Line=39" >39</option>
	<option value="/news_system/t4.php?Line=40" >40</option>
	<option value="/news_system/t4.php?Line=41" >41</option>
	<option value="/news_system/t4.php?Line=42" >42</option>
	<option value="/news_system/t4.php?Line=43" >43</option>
	<option value="/news_system/t4.php?Line=44" >44</option>
	<option value="/news_system/t4.php?Line=45" >45</option>
	<option value="/news_system/t4.php?Line=46" >46</option>
	<option value="/news_system/t4.php?Line=47" >47</option>
	<option value="/news_system/t4.php?Line=48" >48</option>
	<option value="/news_system/t4.php?Line=49" >49</option>
	<option value="/news_system/t4.php?Line=50" >50</option>
</select>
    <td><span class="style19">สถานการณ์</span></td>
    <td>dsubject
	<select id="ddldsub" name="ddldsub" onChange = "Listnode(this.value)">
	<option selected value="">--เลือก--</option>
		<option value="01">น้ำท่วม</option>
			<option value="02">ภัยหนาว</option>
			<option value="03">ภัยแล้ง</option>
			</select>
	node
	<select id="ddlnode" name="ddlnode" style="width:120px" onChange = "Listsubnode(this.value)">
	</select>
   subnode
	<select id="ddlsubnode" name="ddlsubnode" style="width:200px"></select>
	</td>
    <td>&nbsp;</td>
  </tr>
 </table>
</form> 
</body>
</html>


คือถ้าเลือก 1 แถว listmenu จะทำงานได้
แต่ถ้าเลือกมากกว่า 1 แถว แถวจะแสดง แต่ ใช้งาน listmenu ไม่ได้ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-13 08:00:39 By : kung1451
 

 

No. 3



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

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

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

แบบนี้คงยากแล้วครับ เพราะมันจะต้องอ้าง id ของแต่ล่ะ row ด้วยครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-13 08:33:38 By : webmaster
 


 

No. 4



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



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


ถ้าต้องการแสดงข้อมูลที่เลือกของ 1 แถว โดยไม่ต้องกด submit ละครับ ต้องทำยังไงครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-13 08:37:53 By : kung1451
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : การแสดง Listmenu ตามจำนวนแถวที่ได้ระบุค่า แล้วให้แสดง Listmenu ทุกแถว
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 01
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 อัตราราคา คลิกที่นี่