If I have a form where some fields are fixed, what is the best way to present these fields to the user, from UX's 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
hidden
field:<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):
Inmyopinion,thedisabled
fieldsweremorebeautiful,butthey are not sent next to the form ... (besides being easily confused with "not applicable" fields) The readonly
gives no visual indication that they are read-only, and in practice some do not respect this attribute ( select
and checkbox
can still be changed). Using hidden
is up to OK, but I do not know how best to present some of this data to the user (for example, in the case of the on / off value I used the word "yes", but I did not like the result ).
Is there a principle of Usability or User Experience that indicates the best form or, if there is no better, what should I take into consideration when choosing between one representation and another?
Note: Unlike this related question , in this case the fixed fields will not are editable never (ie it is different from a field that does not apply in this context but could apply to another). They are only displayed to locate the user, no action on his part is necessary regarding them.