你这个控件只有visual studio中带了由。

解决方案 »

  1.   

    <input type=file name='file1'  size='15' style='display: none;'>
    <br><input type='text' name='file2' id='file2'>
    <input type=button name='brower' id='brower' style="width:83;height:24" value="浏览" onclick='document.all.file1.click(); document.all.file2.value=document.all.file1.value'>
      

  2.   

    就是把file藏起来,按了取触发那个file的click事件,呵呵
      

  3.   

    但是以孟子E章和我是大猫猫的方法,当在表单里有submit时,需要点击两下才能提交(先单击一下,鼠标从按钮移出,再单击一下才能提交),这是为什么?有方法解决吗?
      

  4.   

    <form enctype="multipart/form-data">
    <input type="file" id="upfile" style="width=200px;">
    <span style="position:relative;left:-80px;width=80;">
    <input type=button onclick="upfile.click();" value=样式随你设>
    </span>
    <span style="position:relative;left:-80px;">
    <input type="submit" value="上传">
    </span>
    </form>
    ------------------
    试试我的方法~~~~~~~~~~~
      

  5.   

    感兴趣,有方法解决吗?
    ----------------------------
    但是以孟子E章和我是大猫猫的方法,当在表单里有submit时,需要点击两下才能提交(先单击一下,鼠标从按钮移出,再单击一下才能提交),这是为什么?有方法解决吗?
      

  6.   

    <script>
    function UpLoadForm_Validator(pUpLoadForm)
    {
    if(document.all.UpLoadFile.value=="")
    {
    window.confirm("请选择上传的文档!");
    pUpLoadForm.UpLoadFile.focus();
    return false;
    }
    var strFileFormat=pUpLoadForm.UpLoadFile.value.match(/^(.*)(\.)(.{1,8})$/)[3];//检查上传文件格式
    strFileFormat=strFileFormat.toUpperCase();
    if(strFileFormat=="DOC"||strFileFormat=="DOT")
    {
    }
    else
    {
    window.confirm("只能上传.Doc和.Dot,请重新选择!");
    return false;
    }
    return true;
    }</script>
    <form method="POST" enctype="multipart/form-data" action="" onsubmit="return UpLoadForm_Validator(this)" laguage="JavaScript" name="UpLoadForm">
    <input type="file" name="UpLoadFile" id="UpLoadFile" style="visibility:hidden;">
    <input type=button onclick="UpLoadFile.click();" style="background-color:#336699">
    <input type="submit" value="上传" name="UpLoadButton">
    </form>
      

  7.   

    gjd111686(数字金刚)-----写的不错,可惜不对题。不是要上传,是要返回路径,且提交后可以在页面中保留路径,孟子E章已解决一大半,只是要按两次按钮。
      

  8.   

    <input type="file" name="UpLoadFile" id="UpLoadFile" style='display:none' >
    <input type=button onclick="UpLoadFile.click();">可以的
      

  9.   

    patchclass(黑翼)--请先测试一下gjd111686(数字金刚)的源码,再看能否提交后可以在页面中保留路径.不是要上传,是要返回路径.用户选一次路径,提交,返回的页面中,原路径还显示.先看看net_lover(孟子E章) 的源码,你就明白了.
      

  10.   

    这个问题我搜索了一遍,一共有两个办法(不算ActiveX).但都不是最佳.一个是net_lover(孟子E章)的,但当在表单里有submit时,需要点击两下才能提交.另一个是woyingjie(killerj.style.display == "none";)(隐身中..........)的,这个方法出现过多次,但页面很难摆齐.有没有高手可以解决?
      

  11.   

    ???
    你在点第一次 的时候自动触发第二次提交不久可以了

    formname.submit()
      

  12.   

    怎么自动触发?在form onsubmit()中?好象不行。你试过没?
      

  13.   

    如果把file field变成服务端运行,好像不能正确返回,麻烦哪位高人指点一下,让file field变成服务端运行也好用,(按钮显示为样式随你设)
    <form enctype="multipart/form-data">
    <input type="file" id="upfile" style="width=200px;">
    <span style="position:relative;left:-80px;width=80;">
    <input type=button onclick="upfile.click();" value=样式随你设>
    </span>
    <span style="position:relative;left:-80px;">
    <input type="submit" value="上传">
    </span>
    </form>
      

  14.   

    接上贴;当按“上传“按钮后,file field中的值就没有拉,而且还要按两次才能回发。在后台程序中得到的upfile.PostedFile.ContentLength老是0,根本没有传回来。