Results 1 to 4 of 4

Thread: file menu opening

  1. #1
    Join Date
    Dec 2007
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default file menu opening

    Hi.. i want to make an input form that opens a file menu...
    i mean the same as <input type="file"> but without the [browse] button.. instead, the file menu to pops when the user clicks insite the input field..

    i.e. the thing i need is how to call that file menu through javascipt.. the other part is easy
    Last edited by SteeleR; 12-26-2007 at 06:25 PM. Reason: not very good english :)

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    javascript cannot access your computer directly by itself. You would need to use some ActiveX components which of course are proprietary to IE, therefore it will not work with non-IE based browsers. eg Firefox / Mozilla / Opera / Konquerer / Netscape

    what is the problem with using the <input type="file" name="" value=""> field?

  3. #3
    Join Date
    Dec 2007
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    nothing wrong to me.. but the designer...

    thanks for the info..

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Something like so (IE only - others will see a normal fie input with a 'Browse' or 'Choose' button):

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    #file1 {
    display:none;
    }
    </style>
    <!--[if IE]>
    <style type="text/css">
    #file1 {
    display:block;
    }
    #file {
    display:none;
    }
    </style>
    <![endif]-->
    </head>
    <body>
    <div id="file1">
    File: <input id="filet" type="text" onclick="document.getElementById('finput').click();">
    </div>
    <div id="file">
    <input id="finput" type="file" onchange="document.getElementById('filet').value=this.value;">
    </div>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •