2014-06-26 40 views
0

我在控制檯窗口中收到上述錯誤。該頁面有一個文本框和按鈕。在文本框中輸入值(註冊碼)後,該值將被傳遞給數據庫以獲取關於註冊碼的信息。但是,當點擊按鈕什麼也沒有發生,並在控制檯中,我可以看到上述錯誤。我正在使用IE9 這是在IE9兼容性視圖中正常工作。 Developer tool的代碼如下所示。請告訴我如何解決此問題。提前致謝 !SCRIPT5009:'submit'未定義xxxx.asp,第43行字符1

<html> 
<head> 
<title>Vehicle Information List</title> 
<link REL="stylesheet" TYPE="text/css" HREF="/msclassicdealer/bin/include/intranet.css"> 
</head> 

<form NAME="PartsVehicleInfo" ACTION="PartsVehicleInfo.asp" METHOD="post"> 

<script LANGUAGE="JavaScript"> 
    function ClickImage(n){ 
     var objSrc = window.event.srcElement.style; 
     objSrc.posTop = n; 
     objSrc.posLeft = n; 
    } 
</script> 

<body BACKGROUND="/msclassicdealer/bin/images/background.gif" BGCOLOR="#ffffff"> 
<table border="0" cellpadding="0" cellspacing="0" width="100%"> 
    <tr> 
     <td width="75" height="22">&nbsp;</td> 
     <td valign="middle" align="center" class="titleback"><p class="heading">Vehicle Information</p></td> 
     <td width="75">&nbsp;</td> 
    </tr> 
    <tr> 
     <td colspan="3" align="center">&nbsp;</td> 
    </tr> 

</table> 

<table align="center" border="0" cellPadding="0" cellSpacing="0"> 
<tr> 
    <td colspan=2>Please enter vehicle registration information</td> 
</tr> 
<tr><td colspan=2><br></td></tr> 
<tr> 
    <td align="right"><b>Registration (VRM)&nbsp;&nbsp;</b></td> 
    <td><input type="text" name="txtReg" value=""/></td> 
</tr> 
<tr>  
    <td colspan="2" align="center"> 
     <a onclick="submit()" style="cursor: pointer;"/> 
     <img name="Search" alt="Search for vehicle" src="/msclassicdealer/bin/images/buttons/search.gif" border="0" style="position:relative;top:0;left:0;" onmousedown="ClickImage(2)" onmouseup="ClickImage(0)" width="30" height="30"/> 
    </td> 
</tr> 
</table> 


</body> 
</form> 
</html> 
+0

你的HTML沒有很好地形成(''裏面''

),但無論如何...'提交()'**沒有定義**(至少在你的代碼提供) 。給你的表單提供一個ID並用'document.yourFormId.submit()'提交。作爲備選方案,僅使用'name'保留''並使用'GetElementsByName()'(或'document.forms [0]'列表)。 –

回答

0

這就是所有相當......老派。

<a onclick="submit()" ...

你有沒有這樣的功能。

<a onclick="document.forms['PartsVehicleInfo'].submit();" ...

相關問題