473,466 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can HMTLInputFile textfield be readonly?

ML
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
Nov 19 '05 #1
1 875
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]
"ML" <ML@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: C. Armour | last post by:
Help me, I'm suffering! Situation: I have a load() function which loads a bunch of TextFields with values. There are TextListeners registered for each of these TextFields. Thus, changing the...
1
by: Suresh | last post by:
How do I insert a char into the textfield on the keypress event of another textfield? I have two textboxes, "text1" and "text2". Important: "text1" is outside the table. "text2" is inside...
3
by: Sidney Linkers | last post by:
Hi, I'm trying to make a calculated text field in a query where the textvalue is being populated from multiple records. I already use a VBA function to loop through records and concatenate the...
9
by: learning | last post by:
Hi! Here's my situation: I have one textfield with one 'submit' button in PAGE1.PHP. When I click on the 'submit' button I am sent to PAGE2.PHP where I have a "switch" routine that checks...
2
jkmyoung
by: jkmyoung | last post by:
I was trying to create an applet with a TextField that would only accept an integer, and ignore any other keystrokes. Eg, if a user typed in an 'f' into the field, the TextField should ignore it, and...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.