PDA

View Full Version : file menu opening



SteeleR
12-26-2007, 05:47 PM
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 :)

boogyman
12-26-2007, 07:36 PM
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?

SteeleR
12-27-2007, 02:01 AM
nothing wrong to me.. but the designer... :)

thanks for the info..

jscheuer1
12-27-2007, 03:15 AM
Something like so (IE only - others will see a normal fie input with a 'Browse' or 'Choose' button):


<!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>