function dd_onclick() {
dd.myfile.click();
dd.temp.value = dd.myfile.value;
document.dd.submit()
}

解决方案 »

  1.   

    呵呵~~,没有submit!
    看下你的代码,除了不想让人填写路径外,没什么特殊要求啊?
    这样岂不是很方便?
    <input type="file" onchange="if(this.value!='')this.form.submit()" readonly>
      

  2.   

    哪是说明这种方法的例子,我是用这种提交方式的.
    <form  name="teacher_add"  action="teacher.do?actionCode=newadd" method="post" onSubmit="return check();"  ENCTYPE="multipart/form-data" >
    其中check()是对提交的检测,但是用了上述的方式就不能实现提交,????????
      

  3.   

    在window_onload()中写dd.myfile.style.visibility='hidden' function dd_onclick() {
    dd.myfile.click();
    dd.temp.value = dd.myfile.value;
    hiddendiv.style.display="none"
    }<BODY>
    <form name=dd>
    <div id=hiddendiv>
    <input type=file name="myfile" style="visibility:hidden">
    <input type=text name=temp readonly>
    <input type=button name="vv" LANGUAGE=javascript value="上传" onclick="return dd_onclick()">
    </div>
    </form>
    </BODY>
      

  4.   

    各们楼上要注意,是不是自己测试过那样可以提交成功??
    解决方法在这里,已经讨论过了
    http://community.csdn.net/Expert/topic/3338/3338523.xml?temp=.573147