<script language = "JavaScript">
//**** List Province (Start) ***//
function ListSub(SelectValue)
{ adminform.ddlSub.length = 0 ติดเออเรอ บรรทัดนี้อะค่ะ
//*** Insert null Default Value ***//
var myOption = new Option('','')
adminform.ddlSub.options[adminform.ddlSub.length]= myOption
<?
$intRows = 0;
$strSQL = "SELECT * FROM product_sub where display='1' ORDER BY level 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["id_type"];?>;
strValue = "<?=$objResult["id_sub"];?>";
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])