Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to restrict user from input in <input type="file">

Reply
Thread Tools

how to restrict user from input in <input type="file">

 
 
Tarkeshwar
Guest
Posts: n/a
 
      04-17-2006
Hi All,
I want to restrict the user from being entering the value in
<input type="file">. It works fine in IE but not in Mozilla. I am
sending my code also which works in IE and not in Mozilla.Can anybody
have the solution.

Thanks in advance.


code :

<input type="file" name="theFile" ContentEditable="false" size="40">

 
Reply With Quote
 
 
 
 
Janwillem Borleffs
Guest
Posts: n/a
 
      04-17-2006
Tarkeshwar wrote:
> Hi All,
> I want to restrict the user from being entering the value in
> <input type="file">. It works fine in IE but not in Mozilla. I am
> sending my code also which works in IE and not in Mozilla.Can anybody
> have the solution.
>


You could it with <input type="file" onkeypress="return false" />, but
what's the use? It only annoys users when features like this are blocked...


JW


 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      04-17-2006
Tarkeshwar wrote:
> Hi All,
> I want to restrict the user from being entering the value in
> <input type="file">. It works fine in IE but not in Mozilla. I am
> sending my code also which works in IE and not in Mozilla.Can anybody
> have the solution.


There isn't one. You can disable the element, but then the user can't
use it at all. You can try 'readonly' but that is only supposed to work
with type text or password, results may vary.


> code :
>
> <input type="file" name="theFile" ContentEditable="false" size="40">


contenteditable is a Microsoft proprietary attribute, it is not part of
HTML 4. It is not supposed to be available for input type=file, only for:

"...INPUT type=button, INPUT type=password, INPUT type=radio,
INPUT type=reset, INPUT type=submit, INPUT type=text..."

<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/contentEditable.asp>

The fact that it 'works' means that there is either a bug in IE or the
MSDN documentation is wrong.


--
Rob
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Restrict user if user directly types url of any page Jaydeep ASP .Net 3 06-30-2006 04:40 AM
Restrict user input sconeek@gmail.com Javascript 10 01-20-2006 12:40 PM
Restrict the user to a particular folder in OpenFileDialog Control Paras Wadehra ASP .Net 1 08-15-2004 12:21 PM
How to restrict the user to use ildasm tool on my assembly Prasad ASP .Net 1 01-16-2004 05:18 PM



Advertisments