|
 |
|
เอา code JavaScript ไปวางไว่ใน head พอวางแล้ว หน้าจอหายไปหมดเลย |
|
 |
|
|
 |
 |
|
ถ้าเอาJavaScriptออกหน้าจอก็เป็นปกติเครียดมาหลายวันแล้วครับสำหรับเรื่องนี้
Code (PHP)
<?
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=tis620"/>
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen"/>
<script type="text/javascript" src="js/chkidnum.js"></script>
<script language = "JavaScript"> //ตัวที่เป็นปัญหา
//**** List Province (Start) ***//
function ListProvince(SelectValue)
{
frmMain.ddlProvince.length = 0
frmMain.ddlAmphur.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.ddlProvince.options[frmMain.ddlProvince.length]= myOption
<?
$intRows = 0;
$strSQL = "SELECT * FROM province";
$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["GEO_ID"];?>;
strValue = "<?=$objResult["PROVINCE_ID"];?>";
strItem = "<?=$objResult["PROVINCE_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.ddlProvince.options[frmMain.ddlProvince.length]= myOption
}
<?
}
?>
}
//**** List Province (End) ***//
//**** List Amphur (Start) ***//
function ListAmphur(SelectValue)
{
frmMain.ddlAmphur.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.ddlAmphur.options[frmMain.ddlAmphur.length]= myOption
<?
$intRows = 0;
$strSQL = "SELECT * FROM amphur";
$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["PROVINCE_ID"];?>;
strValue = "<?=$objResult["AMPHUR_ID"];?>";
strItem = "<?=$objResult["AMPHUR_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.ddlAmphur.options[frmMain.ddlAmphur.length]= myOption
}
<?
}
?>
}
//**** List Amphur (End) ***//
</script>
</head>
<?
include('lib/connectdb.inc.php');
include('lib/function.inc.php');
?>
<body>
Tag : PHP, MySQL, HTML/CSS, JavaScript, Ajax

|
|
 |
 |
 |
 |
Date :
2010-09-30 22:29:41 |
By :
airzio |
View :
884 |
Reply :
6 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่errorนะครับแต่หน้าจอ ขาว ข้อมูลในเวปไม่แสดง
|
 |
 |
 |
 |
Date :
2010-09-30 22:30:28 |
By :
airzio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เจอสุดที่ทำให้เป็นแบบนี้แล้วคือ ส่วนที่เป็น php ในสคิปแต่ผมแก้ส่วนที่เป็นphpให่เป็นจาวาสคิปไม่เป็นใครก็ได้ช่วยทีครับ โปรเจคทำต่อไม่ได้เลย
Code (JavaScript)
function ListProvince(SelectValue)
{
frmMain.ddlProvince.length = 0
frmMain.ddlAmphur.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.ddlProvince.options[frmMain.ddlProvince.length]= myOption
<?
$intRows = 0;
$strSQL = "SELECT * FROM province";
$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["GEO_ID"];?>;
strValue = "<?=$objResult["PROVINCE_ID"];?>";
strItem = "<?=$objResult["PROVINCE_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.ddlProvince.options[frmMain.ddlProvince.length]= myOption
}
<?
}
?>
}
|
 |
 |
 |
 |
Date :
2010-10-01 02:19:28 |
By :
airzio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้ละครับตกหลังหมาตายจริงๆ ใส่connect db ไว้บนสุดก็ได้แล้ว
|
 |
 |
 |
 |
Date :
2010-10-01 02:32:05 |
By :
airzio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
    
|
 |
 |
 |
 |
Date :
2010-10-01 09:08:51 |
By :
nerobenz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับได้แล้วครับ
|
 |
 |
 |
 |
Date :
2010-10-01 12:42:44 |
By :
airzio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|