Jaxel
Well-known member
- Affected version
- 2.2
If I put the following code in a template:
I will properly get the following result:
HOWEVER, If I put
You'll notice there, that it added a
This is actually a pretty big flaw. There is a fundamental different in forms between readonly and disabled. Disabled completely disables the form field; so that on submit, the field itself does not get sent to the server. However, with readonly, the field is still enabled, it just can not be changed; so the value in the field is still submitted to the server.
<xf:textboxrow name="test_name" value="{$test.name}" readonly="readonly" />
I will properly get the following result:
<input type="text" class="input" readonly="readonly" name="test_name" value="my_value">
HOWEVER, If I put
readonly="readonly"
in an <xf:select
menu, I get a slightly different result. I will instead get:<select name="test_name" class="is-readonly input" disabled="disabled">
You'll notice there, that it added a
disabled="disabled"
instead of a readonly="readonly"
.This is actually a pretty big flaw. There is a fundamental different in forms between readonly and disabled. Disabled completely disables the form field; so that on submit, the field itself does not get sent to the server. However, with readonly, the field is still enabled, it just can not be changed; so the value in the field is still submitted to the server.