Can HMTLInputFile textfield be readonly?

G

Guest

Hi NG!

I have this problem:

On an .aspx page an HTMLInputFile control allows the user to upload a file
from the local harddrive to the webserver. However, when the user has browsed
to a valid file, it is possible for him to change the path in the textbox
AFTERWARDS, to something invalid.. Is there any way to set the textbox part
of the control to read-only, so that the only way to specify a file is by
using the 'browse' button?

Any other thoughts on how to solve the problem?

Thanks!

regards,

ML
 
M

Mona

Hi,

You can use the following code snippet to avoid the user
changing the path after browing for a file.

<INPUT type="file" id="hif" onkeydown="return false;">

HTH

Mona[Grapecity]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top