473,386 Members | 1,873 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,386 software developers and data experts.

readonly versus disabled attributes

what's the differences between readonly and disabled attribute??
When I do the post, it couldn't get both values <%= fname %>. any ideas??

<input type="text" name="fname" value="Joe" readOnly>
<input type="text" name="fname" value="Joe" disabled>

Jul 19 '05 #1
2 1960


Matt wrote:
what's the differences between readonly and disabled attribute??
When I do the post, it couldn't get both values <%= fname %>. any ideas??

<input type="text" name="fname" value="Joe" readOnly>
The data of a readonly control is submitted but the user cannot edit the
data.
<input type="text" name="fname" value="Joe" disabled>


A disabled input is not submitted. Disabling input statically doesn't
make much sense usually as you don't know if script is available to
enable the element when needed therefore consider not to use the
disabled attribute with HTML and instead to disable with script when needed.
--

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

Jul 19 '05 #2
Martin Honnen wrote on 13 mrt 2004 in
microsoft.public.inetserver.asp.general:
Matt wrote:
what's the differences between readonly and disabled attribute??
When I do the post, it couldn't get both values <%= fname %>. any
ideas??

<input type="text" name="fname" value="Joe" readOnly>


The data of a readonly control is submitted but the user cannot edit
the data.
<input type="text" name="fname" value="Joe" disabled>


A disabled input is not submitted. Disabling input statically doesn't
make much sense usually as you don't know if script is available to
enable the element when needed therefore consider not to use the
disabled attribute with HTML and instead to disable with script when
needed.


This is not the case with serverside code.

<% if zipdone then disab="disabled" else disab="" %>

<input type=submit name="zip" <%=disab%>>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3

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

Similar topics

4
by: kaeli | last post by:
Hi all, I have form elements that I want to not be editable. They should, however, be passed on submission. AFAIK, then, they need to be readonly. (intranet app where elments are created...
3
by: Gary Homewood | last post by:
I have a form with some input text fields, and I am toggling them between readOnly and enterable, using JavaScript. In Mozilla, when the input is set to readOnly, the background is greyed out...
1
by: Jack | last post by:
Hi, I have a asp page where a checkbox, when clicked will disable all text boxes associated with the page. The following is a part of a code for the checkbox with its name and readonly...
3
by: Matt | last post by:
I want to know if readOnly attribute doesn't work for drop down list? If I try disabled attribute, it works fine for drop down list. When I try text box, it works fine for both disabled and...
3
by: Michael SL | last post by:
I have a text area in which I have a client side javascript to process a "onclick". Because it is client side, I used a HtmlTextArea <TextArea id="Summary" onmouseup="SumMouseUp()" style="WIDTH:...
2
by: Suma | last post by:
Hi To open a notepad file, right now I am using Process.start. But this does not ensure that the file is opened in readonly mode How can I make a notepad file open in Readonly mode I do not...
1
by: Paul | last post by:
Aside from a property being able to show up in the forms designer, is there any reason - other than adhering to a particular coding convention for its own sake - to use a readonly property instead...
12
by: eric.goforth | last post by:
Is there any reason to use: Private newPropertyValue As Integer Public ReadOnly Property MyProperty(ByRef MyParam as Integer) As Integer Get Return newPropertyValue End Get End Property
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello misters I am having troubles impementing the readonly attribute properly. In case the readonly attribute is set on the server side, I added an attribute:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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:
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...

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.