<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>Ikito &#187; HTML</title>
	<atom:link href="http://ikito.net/blog/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://ikito.net/blog</link>
	<description>El Blog de Iko</description>
	<lastBuildDate>Thu, 19 Apr 2012 10:00:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Readonly vs disabled</title>
		<link>http://ikito.net/blog/2009/11/readonly-vs-disabled/</link>
		<comments>http://ikito.net/blog/2009/11/readonly-vs-disabled/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 12:19:20 +0000</pubDate>
		<dc:creator>ikito</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[Problema]]></category>

		<guid isPermaLink="false">http://ikito.net/blog/?p=14</guid>
		<description><![CDATA[Muchas veces la solución a un problema está delante de tus narices pero no eres capaz de verlo, estas tan metido en tu código que no eres capaz de salirte y verlo objetivamente. Para mi esa es una de las mejores virtudes que puede tener un buen programador, ser capaz de desconectar y ver de [...]]]></description>
			<content:encoded><![CDATA[<p>Muchas veces la solución a un problema está delante de tus narices pero no eres capaz de verlo, estas tan metido en tu código que no eres capaz de salirte y verlo objetivamente. Para mi esa es una de las mejores virtudes que puede tener un buen programador, ser capaz de desconectar y ver de nuevo el código desde otro punto de vista. Esto lleva años y años así que mi consejo suele ser&#8230; Dile al compañero que lo mire. Seguro que el, que está fuera es capaz de localizar tu fallo muchisimo mas rápido que tu.</p>
<p>Hoy se me ha dado una situación de &#8220;bloqueo&#8221; que he podido resolver por mi mismo y en relativo poco tiempo, el problema consistía en que al hacer submit en un formulario había ciertos valores que no se estaban pasando por POST. En este formulario para evitar que el usuario (tonto y manazas por naturaleza) habíamos colocado la propiedad &#8220;disabled&#8221; a algunos campos de texto, motivo por el cual tras muchos cabezazos descubrimos que la propiedad &#8220;disabled&#8221; hace que el input no sea tenido en cuenta por el formulario para pasar por POST.</p>
<p>Mi consejo.</p>
<p>Usad disabled solo exclusivamente cuando no se necesite ese valor al hacer submit, en cualquier otra situación se debe usar la propiedad &#8220;read-only&#8221; que aunque no permite la escritura si que permite pasar el value por POST en el formulario.</p>
<p>Aquí una descripción algo mas detallada obtenida del <a title="Readonly y disabled en W3C" href="http://www.w3.org/TR/html401/interact/forms.html#h-17.12" target="_blank">W3C</a>:</p>
<blockquote>
<h3><a name="h-17.12.1">17.12.1</a> <span title="control::disabled|disabled controls"><a name="disabled">Disabled controls</a></span></h3>
<div>
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-disabled"><samp>disabled</samp></a></dt>
<dd>When set for a form control, this boolean attribute disables the control for user input.</dd>
</dl>
</div>
<p>When set, the <samp>disabled</samp> attribute has the following effects on an element:</p>
<ul>
<li>Disabled controls do not receive focus.</li>
<li>Disabled controls are skipped in tabbing navigation.</li>
<li>Disabled controls cannot be  successful.</li>
</ul>
<p>The following elements support the <samp>disabled</samp> attribute: <samp>BUTTON</samp>, <samp> INPUT</samp>, <samp>OPTGROUP</samp>, <samp>OPTION</samp>, <samp>SELECT</samp>, and <samp> TEXTAREA</samp>.</p>
<p>This attribute is inherited but local declarations override the inherited value.</p>
<p>How disabled elements are rendered depends on the user agent. For example, some user agents &#8220;gray out&#8221; disabled menu items, button labels, etc.</p>
<div>
<p>In this example, the <samp>INPUT</samp> element is disabled. Therefore, it cannot receive user input nor will its value be submitted with the form.</p>
<pre>&lt;INPUT disabled name="fred" value="stone"&gt;</pre>
</div>
<div>
<p><em><strong>Note.</strong> The only way to modify dynamically the value of the <samp> disabled</samp> attribute is through a  script.</em></div>
<h3><a name="h-17.12.2">17.12.2</a> <span title="control::read only|read only controls"><a name="read-only">Read-only controls</a></span></h3>
<div>
<p><em>Attribute definitions</em></p>
<dl>
<dt><a name="adef-readonly"><samp>readonly</samp></a></dt>
<dd>When set for a form control, this boolean attribute prohibits changes to the control.</dd>
</dl>
</div>
<p>The <samp> readonly</samp> attribute specifies whether the control may be modified by the user.</p>
<p>When set, the <samp>readonly</samp> attribute has the following effects on an element:</p>
<ul>
<li>Read-only elements receive focus but cannot be modified by the user.</li>
<li>Read-only elements are included in tabbing navigation.</li>
<li>Read-only elements may be  successful.</li>
</ul>
<p>The following elements support the <samp>readonly</samp> attribute: <samp>INPUT</samp> and <samp> TEXTAREA</samp>.</p>
<p>How read-only elements are rendered depends on the user agent.</p>
<p><em><strong>Note.</strong> The only way to modify dynamically the value of the <samp> readonly</samp> attribute is through a  script.</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ikito.net/blog/2009/11/readonly-vs-disabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
