|
 |
|
ถามเรื่อง listbox 2 ชั้น ให้สามารถรับบน firefox ได้ คับ |
|
 |
|
|
 |
 |
|
ถามเรื่อง listbox 2 ชั้น ให้สามารถรับบน firefox ได้ คับ
Code (PHP)
<script type=text/javascript >
var arrItems = new Array();
var arrItemsGrp = new Array();
var arrItemValue = new Array();
var arrItems2 = new Array();
var arrItemsGrp2 = new Array();
var arrItemValue2 = new Array();
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("projectdb");
$sql11= "select * from subside";
mysql_query("SET NAMES UTF8");
$result11=mysql_query($sql11);
while($row11=mysql_fetch_row($result11)) {
$x=$x+1;
echo "x=".$x.";";
$aaa=$row11[2];
$tbn=$row11[1];
$tbi=$row11[0];
echo "a=".$aaa.";";
echo "b='".$tbn."';";
echo "c=".$tbi.";";
?>
arrItems2[x]=b;arrItemsGrp2[x]=a;arrItemValue2[x]=c;
<? }
?>
function selectChange(control, controlToPopulate, ItemArray, GroupArray){
var myEle ;
var x ;
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
myEle = document.createElement("option") ;
myEle.value = " ";
myEle.text = " -- เลือกประเภท -- " ;
controlToPopulate.add(myEle) ;
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = arrItemValue[x];
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
controlToPopulate.focus();
}
function selectChange2(control2, controlToPopulate2, ItemArray2, GroupArray2){
var myEle ;
var x ;
for (var q=controlToPopulate2.options.length;q>=0;q--) controlToPopulate2.options[q]=null;
myEle = document.createElement("option") ;
myEle.value = " ";
myEle.text = " -- เลือกด้าน -- " ;
controlToPopulate2.add(myEle) ;
for ( x = 0 ; x < ItemArray2.length ; x++ )
{
if ( GroupArray2[x] == control2.value )
{
myEle = document.createElement("option") ;
myEle.value = arrItemValue2[x];
myEle.text = ItemArray2[x] ;
controlToPopulate2.add(myEle) ;
}
}
controlToPopulate2.focus();
}
</script>
<tr>
<td align="right" bgcolor="#00CCCC">ด้านหลัก </td>
<td align="left" bgcolor="#00CCCC">
<select name="side" id="side" size="1"class="fieldselect" onChange='selectChange2(this, form1.subside, arrItems2, arrItemsGrp2);document.getElementById("h_side").value=document.getElementById("side").options[document.getElementById("side").selectedIndex].text;'>
<?
$sql1= "select * from side ";
mysql_query("SET NAMES UTF8");
$result1=mysql_query($sql1);
while($row1=mysql_fetch_row($result1))
{
echo"<option value=".$row1[0].">".$row1[1]."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td align="right" bgcolor="#00CCFF">ด้านย่อย </td>
<td align="left" bgcolor="#00CCFF">
<select name="subside" size="1" class="fieldselect" id="subside" style="width: 180px;" onChange='document.getElementById("h_subside").value=document.getElementById("subside").options[document.getElementById("subside").selectedIndex].text;'>
</select>
</td>
ไม่รู้ว่าจะแก้ไขยังไงให้สามารถรันบน firefox ได้ คับ
ขอบคุณมากคับ
Tag : PHP, MySQL, HTML/CSS, JavaScript

|
|
 |
 |
 |
 |
Date :
2011-09-25 13:08:00 |
By :
arsaetha |
View :
807 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พี่ คับ
ทำตามแล้ว แต่ ยังไม่สามารถ รัน บน firefox ได้ คับ
ช่วยแนะนำให้หน่อย คับ
|
 |
 |
 |
 |
Date :
2011-09-25 18:37:02 |
By :
arsaetha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|