[問題] 用onkeydown顯示資料庫的資料
┌─────────────────┐
│ text div │
│ ┌─────┐ ┌──────┐ │
│ └─────┘ │ │ │
│ textarea │ │ │
│ ┌─────┐ │ │ │
│ │ │ │ │ │
│ │ │ │ │ │
│ │ │ │ │ │
│ └─────┘ └──────┘ │
└─────────────────┘
我想在text打關鍵字
div就會在資料庫找有關關鍵字的資料....
可是我寫出來變成
打第一個字div就顯示資料庫全部的資料
打第二個字才會針對剛第一個字顯然資料
我想要當我打a就會顯示a
當我打as就會顯示as
以下是我的程式碼
<script type="text/javascript" >
function OnShowURL ( str )
{
var url="date.php";
url=url+"?name="+str;
url=url+"&key="+<?php echo $keytime; ?>;
document.notes.target = "show";
document.notes.action = url;
document.notes.submit();
}
</script>
<input type=text name="name" size="60" onkeydown="OnShowURL(this.value)">
<div id="abc"><form name="notes" method="post">
<iframe name="show" ></iframe>
</form></div>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.38.172.42
→
04/06 16:44, , 1F
04/06 16:44, 1F
→
04/06 17:10, , 2F
04/06 17:10, 2F
→
04/06 17:10, , 3F
04/06 17:10, 3F
→
04/06 17:11, , 4F
04/06 17:11, 4F
→
04/06 19:55, , 5F
04/06 19:55, 5F