请高手不吝赐教,不胜感激!

解决方案 »

  1.   

    把style="display:none",再做一个文本框,和一个按钮,然后写js代码调用 
    如fileupload1.click 就可以打开文件对话框了
      

  2.   

    为了安全,file的value属性是只读的
      

  3.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Untitled Page</title>
        <style type="text/css">
       /*file容器样式*/
    a.files
    {
        width: 90px;
        height: 30px;
        overflow: hidden;
        display: block;
        border: 1px solid #BEBEBE;
        background: url(/images/fu_btn.gif) left top no-repeat;
        text-decoration: none;
    }
    a.files:hover
    {
        background-color: #FFFFEE;
        background-position: 0 -30px;
    }
    /*file设为透明,并覆盖整个触发面*/
    a.files input
    {
        margin-left: -350px;
        font-size: 30px;
        cursor: pointer;
        filter: alpha(opacity=0);
        opacity: 0;
    }
    /*取消点击时的虚线框*/
    a.files, a.files input
    {
        outline: none; /*ff*/
        hide-focus: expression(this.hideFocus=true); /*ie*/
    }
       </style>
    </head>
    <body>
        <a href="javascript:void(0);" class="files" id="idFile">
            <input name="" type="file" /></a>
    </body>
    </html>
    /images/fu_btn.gif 这个图片就是按钮图片.