473,560 Members | 2,918 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Making input read-only

How do I make an input type="text" field read only for pages meant for
display on IE 5+ and Netscape 6+?

Thanks - Dave
Jul 20 '05 #1
6 47325
In article <9f************ **************@ posting.google. com>,
la***********@z ipmail.com (D. Alvarado) wrote:
How do I make an input type="text" field read only for pages meant for
display on IE 5+ and Netscape 6+?


<input type="text" ... readonly>

Putting the text as normal text inside the document, rather than an
INPUT, would make it more rigid though. Imagine the READONLY attribute
is not supported..

--
Kris
kr*******@xs4al l.netherlands (nl)
Jul 20 '05 #2
D. Alvarado wrote:
How do I make an input type="text" field read only for pages meant for
display on IE 5+ and Netscape 6+?

Thanks - Dave


<input type="text" value="Not editable" disabled="disab led"/> (XHTML)

OR:

<input type="text" value="Not editable" disabled> (HTML)

--
Anne van Kesteren
<http://www.annevankest eren.nl/>
Jul 20 '05 #3
In article <bt**********@r eader08.wxs.nl> ,
Anne van Kesteren <ma**@annevanke steren.nl> wrote:
How do I make an input type="text" field read only for pages meant for
display on IE 5+ and Netscape 6+?

Thanks - Dave


<input type="text" value="Not editable" disabled="disab led"/> (XHTML)

OR:

<input type="text" value="Not editable" disabled> (HTML)


Hmm... was I wrong with my READONLY attribute? Guess it is back to
school for me.

--
Kris
kr*******@xs4al l.netherlands (nl)
Jul 20 '05 #4


Kris wrote:
In article <bt**********@r eader08.wxs.nl> ,
Anne van Kesteren <ma**@annevanke steren.nl> wrote:

How do I make an input type="text" field read only for pages meant for
display on IE 5+ and Netscape 6+?

Thanks - Dave


<input type="text" value="Not editable" disabled="disab led"/> (XHTML)

OR:

<input type="text" value="Not editable" disabled> (HTML)

Hmm... was I wrong with my READONLY attribute?


No, if the input is meant to be submitted then readonly is the proper way
<input type="text"
name="inputName "
value="whatever "
readonly>
A disabled control doesn't take part in form submission:
http://www.w3.org/TR/html4/interact/...html#h-17.13.2
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #5
Kris wrote:
Hmm... was I wrong with my READONLY attribute? Guess it is back to
school for me.


I think I'm the one still at school and you're the one with the
experience :-)

<http://www.w3.org/TR/html4/interact/forms.html#adef-readonly>

(this was pointed out by the other comment as well)

--
Anne van Kesteren
<http://www.annevankest eren.nl/>
Jul 20 '05 #6
Kris <kr*******@xs4a ll.netherlands> wrote in message news:<kr******* *************** *******@news1.n ews.xs4all.nl>. ..
In article <bt**********@r eader08.wxs.nl> ,
Anne van Kesteren <ma**@annevanke steren.nl> wrote:
How do I make an input type="text" field read only for pages meant for
display on IE 5+ and Netscape 6+?


<input type="text" value="Not editable" disabled> (HTML)


Hmm... was I wrong with my READONLY attribute? Guess it is back to
school for me.


The specification explains the difference:

http://www.w3.org/TR/html4/interact/...#adef-disabled
http://www.w3.org/TR/html4/interact/...#adef-readonly

The values for 'disabled' controls are not submitted with the form
data set, whereas values for 'readonly' controls are.

--- Safalra (Stephen Morley) ---
http://www.safalra.com/hypertext
Jul 20 '05 #7

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

Similar topics

1
4859
by: ron | last post by:
Hi, I'm still new at Python and have been away from programming for a number of years in general. I apologized in advance if this has been discussed extensively already. Is the input() function new? There doesn't seem to be very many examples of it's use. After a lot of searching I did find both the input() and raw_input() statement...
6
20658
by: Liam Gibbs | last post by:
Does anyone know how to make input fields smaller, using a smaller font? I want to know how to make my textboxes and such like the ones at http://www.gracenote.com/music/ , but reading teh code reveals they used a stylesheet to do this, and the stylesheet is not within the public_html directory tree. Does anyone know how to do that in CSS or...
3
1656
by: jb0002 | last post by:
Just making a site with a text input, and it looks big and clumsy. Hotmail's boxes when I compose a message are not as tall, and make th design look more sleek. I'm assuming this is a css thing, but I don' know. Anyone know how I can make mine shorter jb000 ----------------------------------------------------------------------- Posted...
8
30990
by: Patrik Malmström | last post by:
How do I read, write a file binary? I want to open, say, file.exe read it in to the program, then write it out to file2.exe. Like file copy, anyone have a code sample?
10
2526
by: Tibby | last post by:
I need to read/write not only text files, but binary as well. It seems like on binary files, it doesn't right the last 10% of the file. -- Thanks --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release Date: 11/10/2003
8
37078
by: S Shulman | last post by:
Hi All I need to read a file to an array of bytes (any type of file) I tried using FileStream and BinaryReader but it doesn't seem to work Thank you, Shmuel
48
2209
by: Michel Rouzic | last post by:
I know it must sound like a newbie question, but I never really had to bother with that before, and I didn't even find an answer in the c.l.c FAQ I'd like to know what's the really proper way for input a string in an array of char that's dynamically allocated. I mean, I wish not to see any such things as char mystring; I don't want to see...
9
5136
by: sweety | last post by:
Dear All, How to encrypt a C data file and make binary file and then have to read a bin file at run time and decrypt the file and have to read the data. Any help to achive this pls. Would be great if any sample source code provided. Thanks, Sweety
0
337
by: Jay | last post by:
Can any one help? I am trying to automate my DB with VBA and need help with the following. I have a subform that shows orders for advertisements placed. I would like to read the user input to test the value of two fields. The first has a cbo of ad sizes set as full, 1/2 page etc..The second is a price field as currency I am trying to do the...
4
3238
by: Adam Funk | last post by:
I'm using this sort of standard thing: for line in fileinput.input(): do_stuff(line) and wondering whether it reads until it hits an EOF and then passes lines (one at a time) into the variable line. This appears to be the behaviour when it's reading STDIN interactively (i.e. from the keyboard).
0
7632
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8066
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7596
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6191
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5175
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3605
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1169
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.