iFrame 中如何得到 父窗体中的一个 hidden 的值?父窗体 中:<from name='upload_form'>
<td align="left">
  <input type='hidden' id='icon' name='icon' value='/image/default.gif'>
  <iframe id="uploadFrame" name="uploadFrame" frameborder="0" scrolling="no" width="100%" height="153" src="upload.jsp"></iframe>
</td>
</form>iFrame 中有个图片,想得到 父窗体 中隐藏的 hidden 中的值
<from name='sub_form'>
  <img id="headimg1" src="javascript:window.frames['upload_form'].document.getElementById('icon').value;" />
</form>...

解决方案 »

  1.   

    换成:<img id="headimg1" src="window.opener.parent.ducument.getElementById('userIcon')=a.jsp;"  />也不行
      

  2.   

    是:
    <img id="headimg1" src="window.opener.parent.ducument.getElementById('icon')=a.jsp;"  />
      

  3.   

    不需要parent
    你用下面这个方法访问试试.
    window.opener.document.upload_form.ico.value 
      

  4.   


    在upload.jsp中:
    window.parent.window.document.all.icon.value;
      

  5.   

    sub_form.headimg1.location=parent.upload_form.icon.value
      

  6.   

    To: minidaylyTks !  但是您的方法不行啊!很感谢!
      

  7.   

    To: spaceko2006 、jayfleeTks !  很感谢! 不过也是不行啊!
      

  8.   

    window.parent.document.getElementById('icon').value
      

  9.   

    ...
    <from name='sub_form'> 
      <img id="headimg1" src="" /> 
    </form> 
    <script>
    document.getElementById('headimg1').src=window.parent.document.getElementById('icon').value;
    </script>
    ...
      

  10.   

    window.dialogArguments.document.getElementById('icon').value;
    这个肯定可以