|
|
|
ทำ listbox 3 ชั้น ติดต่อกับฐานข้อมูล แต่ว่าสามารถแสดงได้แค่ listbox1 ที่เหลือไม่เปลี่ยนค่าตาม(ทุก listbox จะดึงข้อมูลจากฐานข้อมูล) |
|
|
|
|
|
|
|
Code (PHP)
<?php
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("member");
@mysql_query("SET NAMES UTF8");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>RON</title>
<script language = "JavaScript">
//****ListCode Start****//
function ListCode(selectValue)
{
frm.code.length = 0
frm.name.length = 0
//insert null default value//
var myOption = new Option('','')
frm.code.options[frm.code.length]= myOption
<?
$intRows = 0 ;
$strSQL = "SELECT * FROM code_ron ORDER BY code_id 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["type_id"];?>;
strValue = "<?=$objResult["code_id"];?>";
strItem = "<?=$objResult["code"];?>";
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])
frm.code.options[frm.code.length] = myOptoin
}
<?
}
?>
}
//*****List Code END*****//
//*****List Name Start*****//
function ListName(SelectValue)
{
frm.name.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frm.name.options[frm.name.length]= myOption
<?
$intRows = 0;
$strSQL = "SELECT * FROM name_ron";
$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["code_id"];?>;
strValue = "<?=$objResult["name_id"];?>";
strItem = "<?=$objResult["name"];?>";
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])
frm.name.options[frm.name.length]= myOption
}
<?
}
?>
}
//****List Name END****//
</script>
</head>
<body>
<form action="" method="post" name="frm">
ประเภทอุปกรณ์
<select id="type" name="type" onChange="ListCode(this.value)">
<option selected value=""></option>
<?php
$strSQL = "SELECT * FROM type_ron ORDER BY type_id";
$objQuery = mysql_query($strSQL)or die("Error Query [".$strSQL."]");
while($objResult = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$objResult["type_id"];?>"><?=$objResult["type"];?></option>
<?
}
?>
</select>
รหัสอุปกรณ์
<select name="code" id="code" onChange="ListName(this.value)">
</select>
ชื่ออุปกรณ์
<select id="name" name="name" >
</select>
</p>
<p>serial
<label>
<input type="text" name="serial" id="serial">
</label>
ROA-Code
<label>
<input type="text" name="roa" id="roa">
</label>
ตำแหน่ง
<label>
<input type="text" name="address" id="address">
</label>
</p>
<p>recive_date
<label>
<input name="recive_date" type="text" id="recive_date">
</label>
recive
<label>
<textarea name="recive" id="recive"></textarea>
</label>
</p>
<p>use_date
<label>
<input type="text" name="use_date" id="use_date">
</label>
use
<label>
<textarea name="use" id="use"></textarea>
</label>
</p>
<p>Update By
<label>
<input type="text" name="update_by" id="update_by">
</label>
</p>
</form>
</body>
</html>
<?
mysql_close($objConnect)
?>
Tag : PHP, MySQL, JavaScript
|
|
|
|
|
|
Date :
2012-01-13 09:38:29 |
By :
akkaneetha |
View :
1190 |
Reply :
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
รายละเอียดโครงสร้างตารางครับ
ตารางที่ 1
type_id (int10) PK
type (varchar150)
ตารางที่ 2
code_id (int10) PK
code (varchar150)
type_id (int10)
ตารางที่ 3
name_id (int10) PK
name (varchar150)
code_id (int10)
type_id (int10)
|
|
|
|
|
Date :
2012-01-13 09:48:20 |
By :
akkaneetha |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลอง view source ในหน้า ie มาให้หน่อยครับ
|
|
|
|
|
Date :
2012-01-13 09:50:23 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>RON</title>
<script language = "JavaScript">
//****ListCode Start****//
function ListCode(selectValue)
{
frm.code.length = 0
frm.name.length = 0
//insert null default value//
var myOption = new Option('','')
frm.code.options[frm.code.length]= myOption
x = 1;
mySubList = new Array();
strGroup = 1;
strValue = "1";
strItem = "57DL170BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 2;
mySubList = new Array();
strGroup = 1;
strValue = "2";
strItem = "57DL121BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 3;
mySubList = new Array();
strGroup = 1;
strValue = "3";
strItem = "57DL122BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 4;
mySubList = new Array();
strGroup = 1;
strValue = "4";
strItem = "57DL207BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 5;
mySubList = new Array();
strGroup = 1;
strValue = "5";
strItem = "57DL168BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 6;
mySubList = new Array();
strGroup = 1;
strValue = "6";
strItem = "57DL125BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 7;
mySubList = new Array();
strGroup = 1;
strValue = "7";
strItem = "57DL171BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 8;
mySubList = new Array();
strGroup = 2;
strValue = "8";
strItem = "40PF60BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 9;
mySubList = new Array();
strGroup = 2;
strValue = "9";
strItem = "40PF69BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 10;
mySubList = new Array();
strGroup = 2;
strValue = "10";
strItem = "40PF51BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 11;
mySubList = new Array();
strGroup = 2;
strValue = "11";
strItem = "40PF75BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 12;
mySubList = new Array();
strGroup = 3;
strValue = "12";
strItem = "57DL004NR";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 13;
mySubList = new Array();
strGroup = 4;
strValue = "13";
strItem = "57DL176BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
x = 14;
mySubList = new Array();
strGroup = 4;
strValue = "14";
strItem = "57DL124BB";
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])
frm.code.options[frm.code.length] = myOptoin
}
}
//*****List Code END*****//
//*****List Name Start*****//
function ListName(SelectValue)
{
frm.name.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frm.name.options[frm.name.length]= myOption
x = 1;
mySubList = new Array();
strGroup = 1;
strValue = "1";
strItem = "32-Channel ADSL2+ Board (with 600 ohm Splitter)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 2;
mySubList = new Array();
strGroup = 8;
strValue = "2";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
x = 3;
mySubList = new Array();
strGroup = 2;
strValue = "3";
strItem = "Mini Control Unit Board";
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])
frm.name.options[frm.name.length]= myOption
}
x = 4;
mySubList = new Array();
strGroup = 8;
strValue = "4";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
x = 5;
mySubList = new Array();
strGroup = 3;
strValue = "5";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 6;
mySubList = new Array();
strGroup = 8;
strValue = "6";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
x = 7;
mySubList = new Array();
strGroup = 3;
strValue = "7";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 8;
mySubList = new Array();
strGroup = 3;
strValue = "8";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 9;
mySubList = new Array();
strGroup = 8;
strValue = "9";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
x = 10;
mySubList = new Array();
strGroup = 1;
strValue = "10";
strItem = "32-Channel ADSL2+ Board (with 600 ohm Splitter)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 11;
mySubList = new Array();
strGroup = 1;
strValue = "11";
strItem = "32-Channel ADSL2+ Board (with 600 ohm Splitter)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 12;
mySubList = new Array();
strGroup = 1;
strValue = "12";
strItem = "32-Channel ADSL2+ Board (with 600 ohm Splitter)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 13;
mySubList = new Array();
strGroup = 1;
strValue = "13";
strItem = "32-Channel ADSL2+ Board (with 600 ohm Splitter)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 14;
mySubList = new Array();
strGroup = 3;
strValue = "14";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 15;
mySubList = new Array();
strGroup = 4;
strValue = "15";
strItem = "H83D05CALE01 : 32-channel ADSL2+ and 32-port POTS Combined";
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])
frm.name.options[frm.name.length]= myOption
}
x = 16;
mySubList = new Array();
strGroup = 13;
strValue = "16";
strItem = "H83D00ASDA01 : Analog subscriber DSP Card";
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])
frm.name.options[frm.name.length]= myOption
}
x = 17;
mySubList = new Array();
strGroup = 4;
strValue = "17";
strItem = "H83D05CALE01 : 32-channel ADSL2+ and 32-port POTS Combined";
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])
frm.name.options[frm.name.length]= myOption
}
x = 18;
mySubList = new Array();
strGroup = 13;
strValue = "18";
strItem = "H83D00ASDA01 : Analog subscriber DSP Card";
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])
frm.name.options[frm.name.length]= myOption
}
x = 19;
mySubList = new Array();
strGroup = 3;
strValue = "19";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 20;
mySubList = new Array();
strGroup = 4;
strValue = "20";
strItem = "H83D05CALE01 : 32-channel ADSL2+ and 32-port POTS Combined";
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])
frm.name.options[frm.name.length]= myOption
}
x = 21;
mySubList = new Array();
strGroup = 13;
strValue = "21";
strItem = "H83D00ASDA01 : Analog subscriber DSP Card";
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])
frm.name.options[frm.name.length]= myOption
}
x = 22;
mySubList = new Array();
strGroup = 9;
strValue = "22";
strItem = "Rectifier Huawei";
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])
frm.name.options[frm.name.length]= myOption
}
x = 23;
mySubList = new Array();
strGroup = 1;
strValue = "23";
strItem = "32-Channel ADSL2+ Board (with 600 ohm Splitter)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 24;
mySubList = new Array();
strGroup = 3;
strValue = "24";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 25;
mySubList = new Array();
strGroup = 5;
strValue = "25";
strItem = "Centralized Control Unit Board";
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])
frm.name.options[frm.name.length]= myOption
}
x = 26;
mySubList = new Array();
strGroup = 5;
strValue = "26";
strItem = "Centralized Control Unit Board";
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])
frm.name.options[frm.name.length]= myOption
}
x = 27;
mySubList = new Array();
strGroup = 12;
strValue = "27";
strItem = "H83F1FCBA FAN MA5616";
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])
frm.name.options[frm.name.length]= myOption
}
x = 28;
mySubList = new Array();
strGroup = 13;
strValue = "28";
strItem = "H83D00ASDA01 : Analog subscriber DSP Card";
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])
frm.name.options[frm.name.length]= myOption
}
x = 29;
mySubList = new Array();
strGroup = 9;
strValue = "29";
strItem = "Rectifier Huawei";
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])
frm.name.options[frm.name.length]= myOption
}
x = 30;
mySubList = new Array();
strGroup = 9;
strValue = "30";
strItem = "Rectifier Huawei";
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])
frm.name.options[frm.name.length]= myOption
}
x = 31;
mySubList = new Array();
strGroup = 10;
strValue = "31";
strItem = "RECTIFIER MODULE FMP 16.48 POWER ONE";
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])
frm.name.options[frm.name.length]= myOption
}
x = 32;
mySubList = new Array();
strGroup = 3;
strValue = "32";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 33;
mySubList = new Array();
strGroup = 2;
strValue = "33";
strItem = "Mini Control Unit Board";
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])
frm.name.options[frm.name.length]= myOption
}
x = 34;
mySubList = new Array();
strGroup = 3;
strValue = "34";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 35;
mySubList = new Array();
strGroup = 3;
strValue = "35";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 36;
mySubList = new Array();
strGroup = 6;
strValue = "36";
strItem = "SECONDARY POWER BOARD(MPWA)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 37;
mySubList = new Array();
strGroup = 1;
strValue = "37";
strItem = "32-Channel ADSL2+ Board (with 600 ohm Splitter)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 38;
mySubList = new Array();
strGroup = 7;
strValue = "38";
strItem = "DC Power Input Unit";
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])
frm.name.options[frm.name.length]= myOption
}
x = 39;
mySubList = new Array();
strGroup = 7;
strValue = "39";
strItem = "DC Power Input Unit";
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])
frm.name.options[frm.name.length]= myOption
}
x = 40;
mySubList = new Array();
strGroup = 7;
strValue = "40";
strItem = "DC Power Input Unit";
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])
frm.name.options[frm.name.length]= myOption
}
x = 41;
mySubList = new Array();
strGroup = 4;
strValue = "41";
strItem = "H83D05CALE01 : 32-channel ADSL2+ and 32-port POTS Combined";
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])
frm.name.options[frm.name.length]= myOption
}
x = 42;
mySubList = new Array();
strGroup = 14;
strValue = "42";
strItem = "2 PORT GE OPTICAL PINCH BOARD (O2GN)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 43;
mySubList = new Array();
strGroup = 10;
strValue = "43";
strItem = "RECTIFIER MODULE FMP 16.48 POWER ONE";
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])
frm.name.options[frm.name.length]= myOption
}
x = 44;
mySubList = new Array();
strGroup = 9;
strValue = "44";
strItem = "Rectifier Huawei";
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])
frm.name.options[frm.name.length]= myOption
}
x = 45;
mySubList = new Array();
strGroup = 9;
strValue = "45";
strItem = "Rectifier Huawei";
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])
frm.name.options[frm.name.length]= myOption
}
x = 46;
mySubList = new Array();
strGroup = 11;
strValue = "46";
strItem = "Board PCC Control Rectifier Power One 16.48";
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])
frm.name.options[frm.name.length]= myOption
}
x = 47;
mySubList = new Array();
strGroup = 8;
strValue = "47";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
x = 48;
mySubList = new Array();
strGroup = 8;
strValue = "48";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
x = 49;
mySubList = new Array();
strGroup = 8;
strValue = "49";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
x = 50;
mySubList = new Array();
strGroup = 3;
strValue = "50";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 51;
mySubList = new Array();
strGroup = 3;
strValue = "51";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 52;
mySubList = new Array();
strGroup = 3;
strValue = "52";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 53;
mySubList = new Array();
strGroup = 3;
strValue = "53";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 54;
mySubList = new Array();
strGroup = 3;
strValue = "54";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 55;
mySubList = new Array();
strGroup = 3;
strValue = "55";
strItem = "64 PORT ADSL2+OVER POTS";
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])
frm.name.options[frm.name.length]= myOption
}
x = 56;
mySubList = new Array();
strGroup = 1;
strValue = "56";
strItem = "32-Channel ADSL2+ Board (with 600 ohm Splitter)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 57;
mySubList = new Array();
strGroup = 1;
strValue = "57";
strItem = "32-Channel ADSL2+ Board (with 600 ohm Splitter)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 58;
mySubList = new Array();
strGroup = 7;
strValue = "58";
strItem = "DC Power Input Unit";
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])
frm.name.options[frm.name.length]= myOption
}
x = 59;
mySubList = new Array();
strGroup = 4;
strValue = "59";
strItem = "H83D05CALE01 : 32-channel ADSL2+ and 32-port POTS Combined";
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])
frm.name.options[frm.name.length]= myOption
}
x = 60;
mySubList = new Array();
strGroup = 5;
strValue = "60";
strItem = "Centralized Control Unit Board";
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])
frm.name.options[frm.name.length]= myOption
}
x = 61;
mySubList = new Array();
strGroup = 5;
strValue = "61";
strItem = "Centralized Control Unit Board";
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])
frm.name.options[frm.name.length]= myOption
}
x = 62;
mySubList = new Array();
strGroup = 5;
strValue = "62";
strItem = "Centralized Control Unit Board";
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])
frm.name.options[frm.name.length]= myOption
}
x = 63;
mySubList = new Array();
strGroup = 2;
strValue = "63";
strItem = "Mini Control Unit Board";
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])
frm.name.options[frm.name.length]= myOption
}
x = 64;
mySubList = new Array();
strGroup = 14;
strValue = "64";
strItem = "2 PORT GE OPTICAL PINCH BOARD (O2GN)";
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])
frm.name.options[frm.name.length]= myOption
}
x = 65;
mySubList = new Array();
strGroup = 10;
strValue = "65";
strItem = "RECTIFIER MODULE FMP 16.48 POWER ONE";
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])
frm.name.options[frm.name.length]= myOption
}
x = 66;
mySubList = new Array();
strGroup = 9;
strValue = "66";
strItem = "Rectifier Huawei";
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])
frm.name.options[frm.name.length]= myOption
}
x = 67;
mySubList = new Array();
strGroup = 9;
strValue = "67";
strItem = "Rectifier Huawei";
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])
frm.name.options[frm.name.length]= myOption
}
x = 68;
mySubList = new Array();
strGroup = 8;
strValue = "68";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
x = 69;
mySubList = new Array();
strGroup = 8;
strValue = "69";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
x = 70;
mySubList = new Array();
strGroup = 8;
strValue = "70";
strItem = "POWERWARE RECTIFILER MOD";
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])
frm.name.options[frm.name.length]= myOption
}
}
//****List Name END****//
</script>
</head>
<body>
<form action="" method="post" name="frm">
ประเภทอุปกรณ์
<select id="type" name="type" onChange="ListCode(this.value)">
<option selected value=""></option>
<option value="1">CARD</option>
<option value="2">Rectifier</option>
<option value="3">Fan</option>
<option value="4">Pinboard</option>
</select>
รหัสอุปกรณ์
<select name="code" id="code" onChange="ListName(this.value)">
</select>
ชื่ออุปกรณ์
<select id="name" name="name" >
</select>
</p>
<p>serial
<label>
<input type="text" name="serial" id="serial">
</label>
ROA-Code
<label>
<input type="text" name="roa" id="roa">
</label>
ตำแหน่ง
<label>
<input type="text" name="address" id="address">
</label>
</p>
<p>recive_date
<label>
<input name="recive_date" type="text" id="recive_date">
</label>
recive
<label>
<textarea name="recive" id="recive"></textarea>
</label>
</p>
<p>use_date
<label>
<input type="text" name="use_date" id="use_date">
</label>
use
<label>
<textarea name="use" id="use"></textarea>
</label>
</p>
<p>Update By
<label>
<input type="text" name="update_by" id="update_by">
</label>
</p>
</form>
</body>
</html>
|
|
|
|
|
Date :
2012-01-13 09:53:01 |
By :
akkaneetha |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คุณน่ะสะเพร่าและมั่วเองครับ
selectValue กับ SelectValue (ตัวเล็กใหญ่ มีค่าต่างกันครับ)
myOption กับ myOptoin (พิมพ์ผิด)
|
|
|
|
|
Date :
2012-01-13 10:00:50 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
จริงๆ ด้วย ได้แล้วครับ ขอบคุณมากครับ และก็ขอโทษทีครับที่ไม่ตรวจดูให้ละเอียด
|
|
|
|
|
Date :
2012-01-13 10:10:01 |
By :
akkaneetha |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอรบกวนอีกนิดคับ แล้วถ้าตเกิดว่าเราต้องการให้ พอเลือก listbox 2 แล้ว จะขึ้นค่ามาใน listbox 3 ทันทีเลย จะต้องแก้ไขตรงไหนครับ
|
|
|
|
|
Date :
2012-01-13 14:26:31 |
By :
akkaneetha |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เก็บ Code เป็นวิธีที่ถูกแล้วครับ
|
|
|
|
|
Date :
2012-01-16 16:44:33 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|