By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,244 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,244 IT Pros & Developers. It's quick & easy.

Making input read-only

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a


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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.