473,224 Members | 1,471 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,224 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 1953


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:...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.