Link to home
Create AccountLog in
Avatar of GRCHELPDESK
GRCHELPDESK

asked on

File Upload Control - Force the user to browse

Hello Experts,

I'm using the FileUpload control, and I'd like to force the user to select the file by the browse button.  Is there a way to prevent them from typing the path in the field?

Thanks!
GRCHELPDESK
Avatar of Gary Davis
Gary Davis
Flag of United States of America image

You can't disable the input field without also disabling the browse button.

Gary Davis
set the onkeydown event to return false.

<input type="file" name="txt1" id="txt1" value="" onkeydown="return false;" />
ASKER CERTIFIED SOLUTION
Avatar of third
third
Flag of Philippines image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of GRCHELPDESK
GRCHELPDESK

ASKER

Hello,

That works perfectly Third!  Thanks, you've saved me a headache and helped me meet a deadline.

Cheers,
GRCHELPDESK
welcome. ;-)