|
 |
|
aotocomplete รันบน ie7 ไม่ได้ แต่ ie8 ไม่มีปัญหา ไม่ทราบว่าต้องแก้อย่างไร |
|
 |
|
|
 |
 |
|
ส่วนหัว
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 1.01 Transitional//EN" "http://www.w3.org/TR/html1/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title>จองยานพาหนะ</title>
<script type="text/javascript" src="autocomplete.js"></script>
<link rel="stylesheet" href="autocomplete.css" type="text/css">
ตารางที่มี 2 ตาราง แสดงโดยการเลือกประเภทรถ ถ้า เลือก 1 แสดงตาราง pt เลือก2 แสดงตารางperson
<table width="100%" border="1" id="person" style="display:none" >
<tr>
<TD align="right" valign="top">จำนวนคนเดินทาง</TD>
<TD align="left"><input name="num_person" type="text" id="num_person" size="10" > คน</TD>
<TD align="left"> </TD>
</tr>
<tr>
<TD align="right" valign="top"><span class="style11">*</span>รายชื่อผู้ร่วมเดินทาง : </TD>
<TD align="left">1.<input name="ps1" type="text" id="ps1" >
<input name="h_ps1" type="hidden" id="h_ps1" value=""></TD>
<TD align="left">2.<input type="text" name="ps2" id="ps2">
<input name="h_ps2" type="hidden" id="h_ps2" value=""></TD>
</tr>
. . . มีอยู่ 12 ช่อง
</table
<table width="100%" border="1" id="pt" style="display:none">
<tr>
<td width="25%" align="right">ชื่อผู้ป่วย</td>
<td width="32%" align="left"><input type="text" name="ptname" ></td>
<td width="43%"> </td>
</tr>
<tr>
<td align="right">ชื่อเจ้าหน้าที่</td>
<td align="left">1.<input type="text" name="ps13" id="ps13">
<input name="h_ps13" type="hidden" id="h_ps13" value=""></td>
<td>2.<input type="text" name="ps14" id="ps14">
<input name="h_ps14" type="hidden" id="h_ps14" value=""></td>
</tr>
<tr>
<td> </td>
<td align="left">3.<input type="text" name="ps15" id="ps15">
<input name="h_ps15" type="hidden" id="h_ps15" value=""></td>
<td>4.<input type="text" name="ps16" id="ps16">
<input name="h_ps16" type="hidden" id="h_ps16" value=""></td>
</tr>
</table>
สคริป autocomplete ใส่ก่อนปิด body
<script type="text/javascript">
function make_autocom(autoObj,showObj){
var mkAutoObj=autoObj;
var mkSerValObj=showObj;
new Autocomplete(mkAutoObj, function() {
this.setValue = function(id) {
document.getElementById(mkSerValObj).value = id;
}
if ( this.isModified )
this.setValue("");
if ( this.value.length < 1 && this.isNotClick )
return ;
return "gdata.php?q=" +encodeURIComponent(this.value);
});
}
make_autocom("ps1","h_ps1");
make_autocom("ps2","h_ps2");
make_autocom("ps3","h_ps3");
make_autocom("ps4","h_ps4");
make_autocom("ps5","h_ps5");
make_autocom("ps6","h_ps6");
make_autocom("ps7","h_ps7");
make_autocom("ps8","h_ps8");
make_autocom("ps9","h_ps9");
make_autocom("ps10","h_ps10");
make_autocom("ps11","h_ps11");
make_autocom("ps12","h_ps12");
make_autocom("ps13","h_ps13");
make_autocom("ps14","h_ps14");
make_autocom("ps15","h_ps15");
make_autocom("ps16","h_ps16");
</script>
ปัญหาคือ ถ้าเปิดใน ie7 ตอนที่เปิดมา มันจะโชว์รูปค้นหา เกินมา 1 รูป แต่บน ie8 ไม่มีปัญหาอะไรเลย ส่วนie9 จะไม่แสดงรูปแต่สามารถใช้งานได้ ไม่ทราบว่าต้องแก้ไขอย่างไร
Tag : PHP, JavaScript

|
|
 |
 |
 |
 |
Date :
2012-04-16 13:39:04 |
By :
bong_mrs25 |
View :
903 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2012-04-16 13:47:58 |
By :
bong_mrs25 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|