Re: Using

Hello (sorry, cannot get your name from your original email)

You posted the following message to the W3 mailing list:

----------------------------------------------------------------------------
---------------------------------------------
From: <vknab@voila.fr>
Date: Mon, 17 Mar 2003 18:01:28 +0100
Message-Id: <HBWKMG$36BFDD02F01912CB3ECF6D9A56D0FAF1@voila.fr>
To: "www-html" <www-html@w3.org>

Hello,

I red the input type file problems with default value .... and understand
why there's security problem which avoid this functionality.

But, I don't understand why this does not work.
I just would use the style="display:none" of the input and a image to
display the button. When I click on the picture, I launch input
file.click() . So the popup for  choosing the file to upload appear, the
user choose the file...
But when I submit the form, I have an js error.
There's no security problem here since the user choose the file. So i don't
understand why I have this error.
That 's the difference between :
  - First, the user clicks on the browse button
  - Second, the click is fired with js ?


<form name="formPrincipal" method="post" action="resultat.php"
enctype='multipart/form-data'>
 Fichier 1<input type="file" name="PHOTO1" style="display:none;">
	<input type="text" name="file">
	<img align=middle name="Parcourir" src="../images/parcourir.gif"
border="0"
onClick="document.formPrincipal.PHOTO1.click();
document.formPrincipal.file.value=document.formPrincipal.PHOTO1.value;">
	<input type='button' value='Submit2'
onclick='document.formPrincipal.submit();'>
</form>

----------------------------------------------------------------------------
---------------------------------------------

Did you ever get a resolution to this ?

I have the same problem.

Many thanks,
Tim

Received on Wednesday, 3 December 2003 10:54:37 UTC