顶一下,那代码看不出什么问题啊,唯一的问题就楼上所说的,估计是楼主把script拆开显示

解决方案 »

  1.   

    <html> 
    <form name="form1" method="post" enctype="multipart/form-data" target="targetFrame"> 
    <input type="file" NAME="files" onchange="metho1()"> 
    <input type="button" name="button" onclick="metho2()"/> 
    </form> 
    <iframe name="targetFrame" width="300" height="300"> </iframe> 
    </html> 
    <script>
    function metho1(url){ 
    document.form1.action = '/metho1.do?.....'; 
      document.form1.submit(); 
    } function metho2(url){ 
    document.form1.action = '/metho2.do?.....'; 
      document.form1.submit(); 
    } </script>为了看到效果我把width="300" height="300"加了,测试没有你说的情况,至少在IE6下没有
    其他的我没测试
      

  2.   

    js还是乖乖的放在html里面比较好吧。
      

  3.   

    firefox提交表单 file开头儿的不提交
    把你的代码放到环境里或把提交地址改成相对路径
    这样: (放环境里按你写的就行)
    <html>
    <body>
    <form name="form1" action="xx" method="post" enctype="multipart/form-data"> 
    <input type="file" NAME="files" onchange="metho1()"> 
    <input type="button" name="button" onclick="metho1()" value="metho1" /> 
    <input type="button" name="button" onclick="metho2()" value="metho2" /> 
    </form> 
    <iframe name="targetFrame" width="0" height="0"> </iframe> 
    </body>
    </html>
    <script>
    function metho1(url){
      document.form1.action = 'metho1.do?.....';
      document.form1.submit(); 
    } function metho2(url){ 
    document.form1.action ='metho2.do?.....'; 
      document.form1.submit(); 
    }
    </script>
      

  4.   

    <html> 
    <form id="form1" name="form1" method="post" enctype="multipart/form-data"  target="targetFrame"> 
    <input type="file" NAME="files" onchange="metho1()"> 
    <input type="button" name="button" onclick="metho2()"/> 
    </form> 
    <iframe name="targetFrame" width="0" height="0"> </iframe> 
    </html> 
    function metho1(url){ 
    document.getElementById("form1").action = '/metho1.do?.....'; 
      document.form1.submit(); 
    } function metho2(url){ 
    document.getElementById("form1").action = '/metho2.do?.....'; 
      document.form1.submit(); 
    } 加个id如何呢?
      

  5.   


    <html> 
    <form name="form1" method="post" enctype="multipart/form-data" target="targetFrame"> 
    <input type="file" NAME="files" onchange="metho1()"> 
    <input type="button" name="button" onclick="metho2()"/> 
    </form> 
    <iframe name="targetFrame" width="300" height="300"> </iframe> 
    </html> 
    <script>
    function metho1(url){ 
    document.form1.action = 'http://g.cn'; 
      document.form1.submit(); 
    } function metho2(url){ 
    document.form1.action = 'http://www.baidu.com'; 
      document.form1.submit(); 
    } </script>
    测试过,ff下也没有异常