473,395 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 47314
In article <9f**************************@posting.google.com >,
la***********@zipmail.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*******@xs4all.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="disabled"/> (XHTML)

OR:

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

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #3
In article <bt**********@reader08.wxs.nl>,
Anne van Kesteren <ma**@annevankesteren.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="disabled"/> (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*******@xs4all.netherlands (nl)
Jul 20 '05 #4


Kris wrote:
In article <bt**********@reader08.wxs.nl>,
Anne van Kesteren <ma**@annevankesteren.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="disabled"/> (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.annevankesteren.nl/>
Jul 20 '05 #6
Kris <kr*******@xs4all.netherlands> wrote in message news:<kr*****************************@news1.news.x s4all.nl>...
In article <bt**********@reader08.wxs.nl>,
Anne van Kesteren <ma**@annevankesteren.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
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()...
6
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...
3
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,...
8
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
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...
8
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
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...
9
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...
0
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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:
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...
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...

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.