467,877 Members | 1,283 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

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
  • viewed: 1822
Share:
2 Replies


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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by kaeli | last post: by
3 posts views Thread by Gary Homewood | last post: by
3 posts views Thread by Michael SL | last post: by
12 posts views Thread by eric.goforth | last post: by
1 post views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.