index.html  
<html>  <body>  
<input id="value"  type="text" value="10">  
<iframe id=a src="a.html" width="200" height="100">  </iframe>  
<iframe id=b src="b.html" width="200" height="100">  </iframe>  
</body>  </html>  a.html  
<html>  <body>  
<input id="value"  type="text" onChange="window.parent.value.value=parseInt(b.value.value)+parseInt(this.value);" value="10">  
</body>  </html>  b.html  
<html>  <body>  
<input id="value"  type="text" onChange="window.parent.value.value=parseInt(a.value.value)+parseInt(this.value);" value="10">  
</body>  </html>  
试试

解决方案 »

  1.   

    index.html 
    <html>  <body> 
    <input id="value"  type="text" value="10"> 
    <iframe name="a" src="a.html" width="200" height="100">  </iframe> 
    <iframe name="b" src="b.html" width="200" height="100">  </iframe> 
    </body>  </html> a.html 
    <html>  <body> 
    <input id="value"  type="text" onChange="window.parent.value.value=parseInt(window.parent.b.value.value)+parseInt(this.value);" value="10"> 
    </body>  </html> b.html 
    <html>  <body> 
    <input id="value"  type="text" onChange="window.parent.value.value=parseInt(window.parent.a.value.value)+parseInt(this.value);" value="10"> 
    </body>  </html> 
      

  2.   

    index.html  
    <html>  <body>  
    <input id="value"  type="text" value="10">  
    <iframe id="a" src="a.html" width="200" height="100">  </iframe>  
    <iframe id="b" src="b.html" width="200" height="100">  </iframe>  
    </body>  </html>  a.html  
    <html>  <body>  
    <input id="value"  type="text" onChange="window.parent.value.value=parseInt(window.parent.b.value.value)+parseInt(this.value);" value="10">  
    </body>  </html>  b.html  
    <html>  <body>  
    <input id="value"  type="text" onChange="window.parent.value.value=parseInt(window.parent.a.value.value)+parseInt(this.value);" value="10">  
    </body>  </html>  
      

  3.   

    如果嵌入的框架页面有很多呢?例如嵌入的都是同一个页面,只是id不同,例如
    <iframe src="hits.asp?keywordsid=<%=rs("id")%>" name="<%=rs("id")%>>
    这样该如何处理呢?
      

  4.   

    hits.asp:
    <html>   <body>  
    <input id="value"  type="text" onChange="window.parent.value.value=parseInt(window.parent.b.value.value)+parseInt(this.value);" value="10">  
    </body>   </html> 
    那就更简单了
    把window.parent.b.value.value替换成window.parent.["&request("keywordsid")&"].value.value
      

  5.   

    index.html  
    <html>  <body>  
    <script>function sumValue(){
    value.value=0;
    <%do while not rs.eof%>
    value.value=value.value+<%=rs("id")%>.value.value
    <%rs.movenext
    loop%>
    }
    </script>
    <input id="value"  type="text" value="10">  
    <%do while not rs.eof%>
    <iframe src="hits.asp?keywordsid= <%=rs("id")%>" name="<%=rs("id")%>" id="<%=rs("id")%>">   
    <%rs.movenext
    loop%>
    </body>  </html>  
    --------------------------------
    hits.asp
    <html>   <body>   
    <input id="value"  type="text" onChange="window.parent.sumValue();" value="10">   
    </body>   </html>   
    或者你可以这样写
      

  6.   

    不行啊,那段函数放到页面中,显示出错信息:“缺少对象''”
    <script>function sumValue(){
    value.value=0;
    <%do while not rs.eof%>
    value.value=value.value+<%=rs("id")%>.value.value
    <%rs.movenext
    loop%>
    }
    </script>就是这段
      

  7.   

    你要把打开数据库获取记录集的代码写到前面。
    index.html  
    <html>  <body>  
    <%
    '这里写打开记录集的代码!
    sql="select * from table"
    rs.open sql,conn,1,1
    %>
    <script>function sumValue(){
    value.value=0;
    <%do while not rs.eof%>
    value.value=value.value+<%=rs("id")%>.value.value
    <%rs.movenext
    loop%>
    }
    </script>
    <input id="value"  type="text" value="10">  
    <%
    rs.movefirst
    do while not rs.eof%>
    <iframe src="hits.asp?keywordsid= <%=rs("id")%>" name="<%=rs("id")%>" id="<%=rs("id")%>">   
    <%rs.movenext
    loop%>
    </body>  </html>  
    --------------------------------
    hits.asp
    <html>   <body>   
    <input id="value"  type="text" onChange="window.parent.sumValue();" value="10">   
    </body>   </html>