Re: Change Default font color / style for readonly field
Posted by
Adrian Baker on
URL: https://discuss.orbeon.com/Change-Default-font-color-style-for-readonly-field-tp32659p32669.html
Hi Nelson,
I can't help you with xxforms-readonly-appearance, but one option is to
put both input & output fields in the form, then display either
then inputs or outputs, depending on whether you're in readonly mode.
You could control this using XForms:
<xf:output ref="apple[instance('mode') = 'readonly']"/>
<xf:input
ref="apple[instance('mode') = 'edit']"/>
Or alternatively you could preprocess the form definition using XSLT
and replace inputs with outputs etc (or even generate the matching
outputs using XSLT but still show/hide them using binds/refs).
Adrian
Nelson Tsang wrote:
Hello Adrian,
Yes, I had tried the way you did, it works on the one hand, however, on
the other hand, I need to
display the same forms, which has input fields with values, in a
read-only mode. The entire form is read-only and I cannot make all the
fields as output.
I think the only way at this moment is the xxforms:readonly-appearance
attribute, how can I change the style of that attribute in the CSS is
my next question.
Thanks,
--
Nelson.
On 2/7/07, Adrian
Baker <[hidden email]>
wrote:
Erik
Bruchez wrote:
> Alessandro Vernet wrote:
>> Hi Nelson,
>>
>> On 2/4/07, Nelson Tsang <[hidden email]>
wrote:
>>> Yes, I'm thinking of the input fields (xforms:input). The
case is, for
>>> example, I have some
>>> fields which do the auto calculation in the form which is
make
>>> read-only.
>>> However, it become
>>> grey out that is not what I want (since the grey color is
a little
>>> bit hard
>>> to read in my form.)
>>
>> You can do this with CSS, by adding to your page, in the
<xhtml:head>:
>>
>> <xhtml:style type="text/css">
>> .xforms-readonly input { background: white; color: black; }
>> </xhtml:style>
>>
>> This changes the way the browser renders disabled text fields.
But the
>> browser renders disabled text fields like this for a reason:
it give a
>> cue to the end user that the value cannot be modified. So I am
>> wondering if in this case using an <xforms:output> is
not a better
>> option.
>
> Plus IE 6 ignores styling of read-only controls, so styling is not
> really a solution since Nelson uses IE.
>
> -Erik
I too had this exact problem: disabled inputs are too hard to read in
IE, and there is no way to style them.
Best bet is to stick to an output, and perhaps try and style it in such
a way that the user still understands it's 'data' rather than a label
etc. (eg different color, underline, etc, box effect using different
background color or border, etc)
Adrian
--
You receive this message as a subscriber of the [hidden email]
mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
--
Nelson.
[hidden email]
--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: mailto:
[hidden email]
For general help: mailto:
[hidden email]?subject=help
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws