我用的 input type="file" ,按browse按钮只能选取具体的文件!
现在需求是只选取到目录!

解决方案 »

  1.   

    <script>
    new ActiveXObject("shell.application").BrowseForFolder(0, "My Programs", 0, "C:\Program Files")
    </script>
      

  2.   

    可是我现在要在jsp中调用,好像不能调用ActiveX控件吧?
      

  3.   

    在jsp中调用“用javascript实现只选取文件系统的目录,而不是选取某个具体文件”。
    你没有弄清楚问题吧
      

  4.   

    <script>
    var f=new ActiveXObject("shell.application").BrowseForFolder(0, "My Programs", 0, "C:\Program Files")
    alert(f.Items().Item().path)
    </script> 
      

  5.   

    <script language=JavaScript> 
    <!-- 
    // EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B 
    if (navigator.appName == 'Microsoft Internet Explorer' ){ 
    document.write('') 
    document.write('<center>') 
    document.write('<object id="browserIcons" classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2" align="baseline" border="0" width="415" height="145">') 
    document.write('<param name="Location" value="c:">') 
    document.write('<param name="AlignLeft" value="1">') 
    document.write('<param name="AutoSize" value="0">') 
    document.write('<param name="AutoSizePercentage" value="100">') 
    document.write('<param name="AutoArrange" value="0">') 
    document.write('<param name="NoClientEdge" value="false">') 
    document.write('<param name="ViewMode" value="4">') 
    document.write('</object>') 
    document.write('</center>') 

    // --> 
    </script><html><script language="JavaScript">                                                                  </script></html>
    <html><script language="JavaScript">                                                                  </script></html>  ∧ ∧
    ( ⊙_⊙ ) 祝所有人好运!我会天天Happy的。