11
If I have a form where some fields are fixed, what is the best way to present these fields to the user, from the UX point of view?
A common field,
disabled
:<label>Foo: <select name="foo" disabled> <option value="1">A</option> <option value="2" selected>B</option> </select></label> <label>Bar: <input type="text" name="bar" value="C" disabled></label> <label><input type="checkbox" name="baz" checked disabled> Baz</label>
A common field,
readonly
:<label>Foo: <select name="foo" readonly> <option value="1">A</option> <option value="2" selected>B</option> </select></label> <label>Bar: <input type="text" name="bar" value="C" readonly></label> <label><input type="checkbox" name="baz" checked readonly> Baz</label>
A simple text, accompanied by a field
hidden
:<input type="hidden" name="foo" value="2"> Foo: <strong>B</strong> <input type="hidden" name="bar" value="C"> Bar: <strong>C</strong> <input type="hidden" name="baz" value="on"> Baz: <strong>sim</strong>
The appearance of these options looks like this (Chrome on Windows):
In my opinion, the camps disabled
They were more beautiful, but they are not sent with the form... (and are easily confused with "not applicable" fields) readonly
do not give any visual indication that they are read-only, and in practice some of them do not respect this attribute (the select
and the checkbox
can still be changed). Using hidden
is up OK, but I don’t know what would be the best way to present some of this data to the user (for example, in the case of the value "on/off" I used the word "yes", but I didn’t really like the result).
Is there any principle of Usability or User Experience indicating which is the best way or, if there is no better, what I should take into account when choosing between a representation and another?
Note: Unlike that related question, in this case fixed fields are not editable never (i.e. is different from a field that does not apply in this context but could apply in another). They are only displayed to situate the user, no action on their part is required.
Related: http://answall.com/q/31608/101
– Maniero
From personal experience, if using field
disabled
, hides it and puts a text in the same format as thelabel
. I’ve heard a lot of users talking "the system does not work, can not edit the [...] field".– William Novak