|
 |
|
ทำไมเวลาใช้ Dropdownlist Dependent ส่งค่าไป listmenu แบบ multiple มันถึงมีช่องว่าง |
|
 |
|
|
 |
 |
|
ทำไมเวลาใช้ Dropdownlist Dependent ส่งค่าไป listmenu แบบ multiple มันถึงมีช่องว่างก่อนตลอดเลยอะครับ

Code (JavaScript)
<script language = "JavaScript">
//**** List Business (Start) ***//
function ListBG(SelectValue)
{
frmMain.ddlBG.length = 0
frmMain.select_another.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.ddlBG.options[frmMain.ddlBG.length]= myOption
<?
$intRows = 0;
$strSQL = "SELECT * FROM businessgroup WHERE Enable='T' ORDER BY bg_code ";
$objQuery = mssql_query($strSQL) or die ("Error Query [".$strSQL."]");
$intRows = 0;
while($objResult = mssql_fetch_array($objQuery))
{
$intRows++;
?>
x = <?=$intRows;?>;
mySubList = new Array();
strGroup = <?=$objResult["busi_no"];?>;
strValue = "<?=$objResult["bg_no"];?>";
strItem = "<?=$objResult["bg_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])
frmMain.ddlBG.options[frmMain.ddlBG.length]= myOption
}
<?
}
?>
}
//**** List Business (End) ***//
//**** List BG (Start) ***//
function ListAnother(SelectValue)
{
frmMain.select_another.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.select_another.options[frmMain.select_another.length]= myOption
<?
$intRows = 0;
$strSQL = "SELECT * FROM another WHERE Enable='T' ORDER BY another_name ";
$objQuery = mssql_query($strSQL) or die ("Error Query [".$strSQL."]");
$intRows = 0;
while($objResult = mssql_fetch_array($objQuery))
{
$intRows++;
?>
x = <?=$intRows;?>;
mySubList = new Array();
strGroup = <?=$objResult["bg_no"];?>;
strValue = "<?=$objResult["another_name"];?>";
strItem = "<?=$objResult["another_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])
frmMain.select_another.options[frmMain.select_another.length]= myOption
}
<?
}
?>
}
</script>
Tag : PHP, JavaScript

|
|
 |
 |
 |
 |
Date :
2011-09-05 14:25:53 |
By :
Nos1001 |
View :
1024 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (JavaScript)
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.ddlBG.options[frmMain.ddlBG.length]= myOption
เอาตัวนี้ออกครับ
|
 |
 |
 |
 |
Date :
2011-09-05 14:40:41 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แหล่มครับ ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2011-09-05 14:44:19 |
By :
Nos1001 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|