top.frames["jbxx"].document.getElementsByName("test")[0].style.disabled   =   true; 

解决方案 »

  1.   

    还是不行啊?
    按楼上的方法: 提示 top.frames.jbxx.document 为空或不是对象;
    又改了几种写法都不行,如下:
    window.frames["jbxx"].document.getElementsByName("test")[0].style.disabled = true;
    window.frames["jbxx"].window.document.all["test"].style.disabled = true;
    window.frames["jbxx"].document.all.test.style.disabled = true;都是提示 .... 为空或不是对象。请高手指点。
      

  2.   

    try
    frames["jbxx"].document.form1.test.disabled=true;
      

  3.   

    试了,还是不行啊?
    还是提示: frames.jbxx.document.form1.test 为空或不是对象。
    请高手赐教....
      

  4.   

    我晕...没仔细看,form标签错误
    <from   name="from1"> <input   type="checkbox"   value="1"   name="test"> </from> 
      

  5.   


    <script>
    <iframe name="jbxx" frameborder="0" marginWidth="0" marginHeight="5" width="100%"  height="100%" nowrap scrolling="no" src="a.html"></iframe>
    <script>
    window.onload=function(){
    //以任意一个都可以,
    //楼上不可用的原因,当执行到这句的时候frames["jbxx"],还为加载完成,所以会找不到对象
    //加到window.onload中的话,就是所有都加载完成了,这个时候才能禁止!
    //window.jbxx.test.disabled=true;
    //window.frames["jbxx"].document.getElementsByName("test")[0].disabled = true; 
    //window.frames["jbxx"].window.document.all("test").disabled=true; 
    //window.frames["jbxx"].document.all.test.disabled=true; 
    //top.frames["jbxx"].document.all.test.disabled=true; 
    }
    //这里运行的话,就提示没有对象,因为未加载!
    //window.frames["jbxx"].document.all.test.disabled=true; 
    </script>
      

  6.   

    哈哈!谢谢stayalive 的解释,搞定了, 
    多谢所有回答的朋友!