各位高手門
感謝上次的指導,讓我能找到該如何下手改事件差異,但是我現在又遇到一個新的問題了

,在html中我寫了一個
<input type="text" name="Search" onKeyup="CheckValue();" onKeydown="SetFocue();" size="32" >
<div id="menu" style=""></div>
呼叫的javascript如下
<script type="text/javascript">
function CheckValue()
{
objResult = new Array()
document = handleEvent;
strValue = document.Form1.Search.value;
strScript = "";
if(strValue.length > 0)
{
j = 0;
if(document.all)
{
menu.innerHTML=strScript ;
}
if(document.layers)
{
document.Form1.menu.document.write(strScript);
document.Form1.menu.document.close();
}
for(i = 0 ;i < objList.length ; i ++)
{
if(objList[i].search(strValue) == 0)
{
objResult[j] = objList[i];
j ++
}
}
if(objResult.length > 0)
{
strScript = "<span style='border:1px; solid #000000; position:absolute; overflow:hidden; left:10%;' ><select name='FORUMS_TO_SEARCH' size="+objResult.length+" style='background-color:#ffffff;border=0;width:300px;margin:-2px;' onchange='Form1.Search.value=this.value;' onclick='SetValue();' onKeydown='HiddenMenu();'>"
for(i = 0 ; i < objResult.length ; i ++)
{
strScript += "<option value='" + objResult[i] + "'>"+objResult[i]+"</option>";
}
strScript += "</select></span>";
if(document.all)
{
menu.innerHTML=strScript ;
}
if(document.layers)
{
document.Form1.menu.document.write(strScript);
document.Form1.menu.document.close();
}
menu.style.visibility = "visible";
}
}
}
function HiddenMenu()
{
//Enter
event= handleEvent;
if(event.keyCode == 13)
{
menu.style.visibility = "hidden";
document.Form1.Search.focus();
}
}
function SetValue()
{
document = handleEvent;
document.Form1.Search.value = document.Form1.FORUMS_TO_SEARCH.value;
menu.style.visibility = "hidden";
document.Form1.Search.focus();
}
function SetFocue()
{
//Down
event = handleEvent;
document = handleEvent;
if(event.keyCode==40)
{
if(document.Form1.FORUMS_TO_SEARCH != null)
{
document.Form1.FORUMS_TO_SEARCH.selectedIndex = 0;
document.Form1.FORUMS_TO_SEARCH.focus();
}
}
}
function a_send_db_tables()
{
search = document.Form1.Search.value;
url = "readpagetry.asp?search="+search
window.location=url
}
</script>
使用firefox執行此頁,它會出現紅色字的部份,menu is not defined, 這是為什麼呢? 我該如何定義它呢??
請個位高手指點一下吧!謝謝~