A iframe with name "frameAccountInfo",it has a input element which name property and id property are "accountStat"
I write a script to get the value of accountSta
<script
1 var acobj = document.frames.frameAccountInfo.document
2 alert(acobj.all)
3 alert(acobj.body.all.accountStat.value);
</script
It alerts [object] and [useable
but if I comment the line 2, it shows a javascript error “missing object", why ?Thanks a lot
Regard
Fred - 12 May 2004 06:41 GMT
the cod
----------parent.html-----------------------
<HTML></HEAD><BODY><iframe name="frameAccountInfo" src="frame.html" width="706" height="150"></iframe><script>
var acobj = document.frames.frameAccountInfo.document
//alert(acobj.all)
alert(acobj.body.all.accountStat.value);
</script></BODY></HTML
---------------------frame.html---------------
<HTML></HEAD><body bgcolor="#ffffff"><TABLE class="info" id="Table1" cellSpacing="0" cellPadding="0"><TR><TD class="label" noWrap>帐户状态</TD><TD class="text"><input readOnly type="text"id=accountStat name=accountStat class=noborder-normal style="WIDTH:80px;" value=可用></TD><TD class="label" noWrap>地区码</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:80px;" value=574></TD><TD class="label" style="HEIGHT: 25px">积分值</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:80px;" value=0></TD><TD class="label">可用金额</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:80px;" value=0></TD></TR><TR><TD class="label" style="HEIGHT: 25px">预定金额</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:80px;" value=0></TD><TD class="label" noWrap>赠送金额</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:80px;" value=0></TD><TD class="label" noWrap>可透支金额</TD><TD class="text"><input readOnly type="text"class=noborber-normal style="WIDTH:80px;" value=></TD><TD class="label" noWrap>自动转帐金额</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:80px;" value=0></TD></TR><TR><TD class="label">生效日期</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:80px;" value=></TD><TD class="label">失效日期</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:100px;" value=></TD><TD class="label">修改日期</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:100px;" value=2004-04-05 09:38:51></TD><TD class="label">赠送金额<BR>截至日期</TD><TD class="text"><input readOnly type="text"class=noborder-normal style="WIDTH:100px;" value=></TD></TR></TABLE></body></HTML>
Vidar Petursson - 21 May 2004 10:24 GMT
Hi
alert(document.frames["IFRAMENAME"].document.forms[0].ELEMENTNAME.value);
You may want to check the readystate of the frame before accessing it
if(document.frames["IFRAMENAME"].document.readyState == "complete")
More info:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/referen
ce/dhtml_reference_entry.asp

Signature
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
>A iframe with name "frameAccountInfo",it has a input element which name
>property and id property are "accountStat";
[quoted text clipped - 9 lines]
>
> Regard