Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / March 2005

Tip: Looking for answers? Try searching our database.

how to disable textbox in HTML inputfile control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pc chada - 29 Mar 2005 18:23 GMT
hi,

 i need to protect textbox in HTML inputfile control in .net.Because i dont want enter filename  by typing just i need to browse and select the file.

thanks,
Scott M. - 29 Mar 2005 23:32 GMT
You'll have to implement your own file browsing feature then because INPUT
TYPE="File" can't be modified in the way you are asking about.

> hi,
>
[quoted text clipped - 10 lines]
>
> <Id>ugZ7uKm8YEq7DXkH/WEFKw==</Id>
gabe garza - 30 Mar 2005 02:53 GMT
Add a onkeydown attribute and blur()

<input onkeydown="javascript:this.form.file1.blur();" type="file"
name="file1">

> hi,
>
[quoted text clipped - 10 lines]
>
> <Id>ugZ7uKm8YEq7DXkH/WEFKw==</Id>
Alvin Bruney [ASP.NET MVP] - 30 Mar 2005 03:31 GMT
> Add a onkeydown attribute and blur()
i'm afraid that won't work correctly because the selected file will still
post once it is selected.

Signature

Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________

> Add a onkeydown attribute and blur()
>
[quoted text clipped - 15 lines]
>>
>> <Id>ugZ7uKm8YEq7DXkH/WEFKw==</Id>
gabe garza - 30 Mar 2005 19:52 GMT
That's true, but what the original post wanted was, he didn't want the user
to be able to type in a filename in the text box.

>> Add a onkeydown attribute and blur()
> i'm afraid that won't work correctly because the selected file will still
[quoted text clipped - 19 lines]
>>>
>>> <Id>ugZ7uKm8YEq7DXkH/WEFKw==</Id>
Scott M. - 30 Mar 2005 04:19 GMT
This essentially keeps the user from using the control at all (even the
button, which we want to be able to use).

> Add a onkeydown attribute and blur()
>
[quoted text clipped - 15 lines]
>>
>> <Id>ugZ7uKm8YEq7DXkH/WEFKw==</Id>
gabe garza - 30 Mar 2005 19:35 GMT
Not true, we're using it right now with no problems. Can you send me your
HTML code on how you implemented this.
This is working for IE and FireFox on Windows and IE, FireFox and Safari on
the Mac.

onkeydown is for pressing any key and has nothing to do with the mouse.
When you click on the button you're using the mouse, not a key. Unless you
tab over and press the space bar which will click the button.

> This essentially keeps the user from using the control at all (even the
> button, which we want to be able to use).
[quoted text clipped - 18 lines]
>>>
>>> <Id>ugZ7uKm8YEq7DXkH/WEFKw==</Id>
gabe garza - 30 Mar 2005 19:54 GMT
I jump the gun here, Safari on the MAC doesn't display a text box to type a
file name, it only has a button to select the file.

> Not true, we're using it right now with no problems. Can you send me your
> HTML code on how you implemented this.
[quoted text clipped - 27 lines]
>>>>
>>>> <Id>ugZ7uKm8YEq7DXkH/WEFKw==</Id>
Josh - 30 Mar 2005 16:19 GMT
I havn't tried it, but I  think you could create a control that inherits
from the File upload class and override the HTML render method.  In your
override you just  leave out the textbox.

Anyone tried that?
gabe garza - 30 Mar 2005 20:20 GMT
All the server code does is send over HTML tags, <br>, <hr>, <input>, etc...
to the client browser.
It's the browser that decides what to do with those tags.
In the case of Safari on the Mac, when it sees a <input> tag with a type of
"file", it doesn't display a text box at all only a select button.
IE and FireFox does display the text box along with a button to select a
file.

>I havn't tried it, but I  think you could create a control that inherits
>from the File upload class and override the HTML render method.  In your
>override you just  leave out the textbox.
>
> Anyone tried that?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.