Line:13
Char:2
Code:0
Error:缺少 ';'
网址:http://localhost/temp.asp页面测试代码如下:
<%
strI=request.QueryString("str")
if strI="" then strI="1"
%>
<form action="" name="frm" method="post">
<script language="javascript">
function addPrice(strI)
{
         
strRebate=eval("document.all." + strI + "rebate");
         strPrice=eval("document.all." + strI + "price");
strRebate.value=strPrice.value;
}
</script>
<input onkeyup="addPrice(<%=strI%>)" name="<%=strI%>rebate" type="text" id="<%=strI%>rebate" />
<input  name="<%=strI%>price" type="text" id="<%=strI%>price" />
</form>

解决方案 »

  1.   

    <script language="javascript">
    function addPrice(strI)
    {
             
    document.all[strI + "rebate"].value=document.all[ + strI + "price"].value;
    alert(document.all[strI + "rebate"].value);
    }
    </script>
    </HEAD><BODY>
    <%
    strI=request.QueryString("str")
    if strI="" then 
      strI="1"
    end if
    %>
    <form action="" name="frm" method="post"><input onkeyup="addPrice(<%=strI%>)" name="<%=strI%>rebate" type="text" id="<%=strI%>rebate" />
    <input  name="<%=strI%>price" type="text" id="<%=strI%>price" value=<%=strI%> />
    </form>
      

  2.   

    <%
    strI=request.QueryString("str")
    if strI="" then strI="1"
    %>
    <form action="" name="frm" method="post">
    <script language="javascript">
    function addPrice(strI)
    {        
         frm[+strI+"price"].value=frm[+strI+"rebate"].value;
    }
    </script>
    <input onkeyup="addPrice(<%=strI%>)" name="<%=strI%>rebate" type="text" id="<%=strI%>rebate" />
    <input  name="<%=strI%>price" type="text" id="<%=strI%>price" />
    </form>