它有一个value,验证完之后再把这个value传过来,request.setAtrribute()

解决方案 »

  1.   

    我也试过value属性可是也不管用我是这样写的
    document.forms[0].theFile.value = aaa;aaa是我想要传到标签里的值。这样写是没错,可是值显示不到标签里。。各位大侠,有什么好的高招吗?该怎么写,请帮助一下哈。
      

  2.   


    <html> 
    <head>
    <script>
     function dos()
    {
                var obj=document.forms[0].theFile;
                var shell=new ActiveXObject("WScript.Shell");
                obj.focus();
                shell.SendKeys(document.forms[0].h.value);
    }
        </script>
    </head>
    <body onload=dos()> 
    <form>
    <td>  <input type="file" name="theFile" size="60" > </td> <input type="hidden" name="h" value="aaa">
    </form>
    </body> 
    </html> 
      

  3.   


    <html> 
    <head>
    <script>
     function dos()
    {
                var obj=document.forms[0].theFile;
                var shell=new ActiveXObject("WScript.Shell");
                obj.focus();
                shell.SendKeys(document.forms[0].h.value);
    }
        </script>
    </head>
    <body onload=dos()> 
    <form>
    <td>  <input type="file" name="theFile" size="60" > </td> <input type="hidden" name="h" value="aaa">
    </form>
    </body> 
    </html> 
      

  4.   

    <html> 
    <head>
    <script>
     function dos()
    {
                var obj=document.forms[0].theFile;
                var shell=new ActiveXObject("WScript.Shell");
                obj.focus();
                shell.SendKeys(document.forms[0].h.value);
    }
        </script>
    </head>
    <body onload=dos()> 
    <form>
    <td>  <input type="file" name="theFile" size="60" > </td> <input type="hidden" name="h" value="aaa">
    </form>
    </body> 
    </html> 
      

  5.   

    <html> 
    <head>
    <script>
     function dos()
    {
                var obj=document.forms[0].theFile;
                var shell=new ActiveXObject("WScript.Shell");
                obj.focus();
                shell.SendKeys(document.forms[0].h.value);
    }
        </script>
    </head>
    <body onload=dos()> 
    <form>
    <td>  <input type="file" name="theFile" size="60" > </td> <input type="hidden" name="h" value="aaa">
    </form>
    </body> 
    </html> 
      

  6.   

    你取这个名字有什么用,FILE 是根据你指定的那个文件传送数据,不是名字,你这样取名字没任何意义而且用FILE标签,FORM 传值应该指定 enctype="multipart/form-data"属性
      

  7.   

    11楼的说的对,在form里要指定enctype="multipart/form-data的而且,你在 formbean里取值也要加一个属性才可以
      

  8.   

    用bean:write在旁边显示出来吧,也很醒目的
      

  9.   

    to:11楼
    你的代码确实是好用,放在一个单独的页面里,就可以用,但是放在我自己的页面里就不能用了。
    它提示的错误看不懂,反正就是这句话的错误。
    var shell=new ActiveXObject("WScript.Shell");你知道是哪的问题吗?或者需要配一些属性,或者什么的?请指教!!!
      

  10.   

    sendKeys 是否在struts里用不了啊???在普通页面里用
                var obj=document.forms[0].theFile;
                var shell=new ActiveXObject("WScript.Shell");
                obj.focus();
                shell.SendKeys(document.forms[0].h.value);
    是可以的。但是放到jsp里就不能用了,大侠们这是为何???等待~~~~~~~~~~~~~