Forum de discussion
Forum « Programmation ASP » (archives)
Re: selection d'un repertoire dans un formulaire
Envoyé: 11 mars 2006, 7h53 par Oznog
Localement tu as cette solution mais, pour des raisons évidentes de sécurités, ce n'est pas permis en ligne! Sinon, tu peux toujours faire un exécutable. Un petit Flash (Macromedia) par exemple installé locallement a beaucoup plus de liberté!
Tu peux voir une discussion sur ce code ici http://www.experts-exchange.com/Web/Graphics/Web_Images/Q_21109033.html
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com
<!-- Begin
function DriveList()
{
var folder=document.Drive.Name.options[document.Drive.Name.selectedIndex].value;
document.frames['MyComputer'].location.href = folder;
}
function FolderChoose()
{
var location=document.UserLocation.FolderLocation.value;
document.frames['MyComputer'].location.href = location;
}
// End -->
</script>
</HEAD>
and then put the following script in the body where you want it to go:
<BODY>
<FORM NAME="UserLocation">
<P><font size="2">Type in a Folder Location: </font>
<INPUT TYPE="text" name="FolderLocation" length="25" size="20">
<INPUT TYPE="button" value="Open Folder" onClick="FolderChoose();"></P>
<P><font size="2">EXAMPLE: C:\Program Files\Internet Explorer</font></P>
</FORM>
<IFRAME NAME="MyComputer" SRC="about:blank" WIDTH="50%" HEIGHT="20%"></IFRAME>
</CENTER>
That will allow the user to enter the path, the next peice I took from the website http://javascript.internet.com:
<BODY>
<CENTER>
<FORM NAME="Drive">
<P><font size="2">Choose a Drive: </font>
<SELECT NAME="Name" onChange="DriveList();">
<OPTION VALUE="A:\">A:\ Drive</OPTION>
<OPTION VALUE="C:\">C:\ Drive</OPTION>
<OPTION VALUE="D:\">D:\ Drive</OPTION>
<OPTION VALUE="E:\">E:\ Drive</OPTION>
</SELECT>
</FORM>
Ciao
Oznog
Réponses
|