<input type=button onclick="self.frames['a'].document.all.aaa.disabled=true">
<iframe name='a' src="2.htm"></iframe>2.htm<input type=button value="asdfd" id="aaa">

解决方案 »

  1.   

    我的实现:
    A页面(a.htm):
    <html>
    <head>
    <title>A页面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function OnSelect()
    {
    if(document.forms[0].type.value == 01)
    {
    upload.document.forms[0].photo.disabled = false;
    upload.document.forms[0].upload.disabled = false;
    }
    else
    {
    upload.document.forms[0].photo.disabled = true;
    upload.document.forms[0].upload.disabled = true;
    }
    }
    //-->
    </script>
    <table width="500" border="0" cellpadding="0" cellspacing="1" bgcolor="2070BF">
        <tr align="center"> 
        <td width="100" height="24" bgcolor="#99CCFF">是否可用</td>
        <td height="24" bgcolor="#FFFFFF">
         <select name="type" id="type" onclick="OnSelect()">
             <option value="01">可用</option>
             <option value="02">不可用</option>
            </select>
        </td>
    <tr align="center"> 
        <td width="100" height="48" rowspan="2" bgcolor="#99CCFF">上传文件</td>
        <td height="24" bgcolor="#FFFFFF"> 
         <iframe name="upload" frameborder=0 width=400 height=24 scrolling=no src=b.htm></iframe> 
    </td>
        </tr>
    </table>
    </body>
    </html>B页面(b.htm):
    <html>
    <head>
    <title>B页面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body leftmargin="15" topmargin="2">
    <form name="form" method="post" action="upfile.asp" enctype="multipart/form-data" >
    <input name="photo" type="file" id="photo" size="42">
    <input type="submit" name="upload" id="upload" value="上传">
    </form>
    </body>
    </html>