473,700 Members | 2,851 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 47347
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
4865
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 definitions. I don't understand the reasoning behind making
6
20664
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 HTML? Again, it's the style at http://www.gracenote.com/music/ .
3
1662
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 via http://www.forum4designers.co...
8
31005
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
2540
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
37112
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
2238
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 any number (if possible) I just want to declare something like char *mystring; and then I don't...
9
5157
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 following: when cost has been input read cboAd size option and read txtCost. If cost is less...
4
3248
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
9202
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9058
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8952
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8909
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4395
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4649
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3081
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 we have to send another system
2
2371
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.