By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,460 Members | 1,154 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,460 IT Pros & Developers. It's quick & easy.

Validation on <input type="file">

P: 12
yo yo

can we validate the <INPUT TYPE="FILE">?

WHILE UPLOADING A FILE I NEED TO RESTRICT THE USER FROM ENTERING TEXT DIRECTLY IN THE TEXT FIELD AND SOME FILE VALIDATION HAS TO BE DONE

help me out in handling
Jun 29 '06 #1
Share this Question
Share on Google+
7 Replies


P: 1
yo yo

can we validate the <INPUT TYPE="FILE">?

WHILE UPLOADING A FILE I NEED TO RESTRICT THE USER FROM ENTERING TEXT DIRECTLY IN THE TEXT FIELD AND SOME FILE VALIDATION HAS TO BE DONE

help me out in handling
WHILE UPLOADING A FILE I NEED TO RESTRICT
Aug 6 '06 #2

sashi
Expert 100+
P: 1,754
Hi there,

check out the below sample code segment.. take care..

Expand|Select|Wrap|Line Numbers
  1. <INPUT Disable="True" TYPE="FILE">
  2.  
set the disable attribute to true in order to restrict users from typing any text into the textbox..
Aug 7 '06 #3

P: 1
for validating file control one should use


onbeforeeditfocus="return false;"

it will work definitely



Regards
parv sharma
Sep 14 '07 #4

gits
Expert Mod 5K+
P: 5,390
for validating file control one should use


onbeforeeditfocus="return false;"

it will work definitely



Regards
parv sharma
please don't post your e-mail-address ... it is for your own security ...

kind regards
MOD
Sep 14 '07 #5

acoder
Expert Mod 15k+
P: 16,027
for validating file control one should use


onbeforeeditfocus="return false;"

it will work definitely
Welcome to TSDN!

Unfortunately, your solution would only work in IE. A better solution is to check for key presses (onkeyup/down/press) and prevent them being registered by "return false".
Sep 14 '07 #6

P: 1
Welcome to TSDN!

Unfortunately, your solution would only work in IE. A better solution is to check for key presses (onkeyup/down/press) and prevent them being registered by "return false".
Ya it is working fine..

Try this out...
Dec 24 '07 #7

acoder
Expert Mod 15k+
P: 16,027
Ya it is working fine..

Try this out...
What's working fine?
Dec 24 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.