Read_only - how to set dynamically

we try to set read_only dynamically (with an expression), but - different to relevant and required - this doesn’t seem to work. See attached examples.
Is this not implemented in KoBoCollect?
Furthermore, it seems that read_only is not available in (Enketo) Online FormBuilder.

read_only dynamic 02.xlsx (10.0 KB)

Here are links to the specs:

As in XForms 1.0 this specifies whether the user is allowed to enter data, using a boolean expression. Considered false() if omitted.
6.1.2 The readonly Property*
Description: describes whether the value is restricted from changing.
Computed Expression: Yes.
Legal Values: Any expression that is convertible to XPath boolean with boolean().
Default Value: false(), unless a calculate property is specified, then true().

still need support on this question, please.
Find attached some exercises without being able to set read_only dynamically.
Read_only Dynamic 02.xlsx (10.6 KB)

Can anyone provide an example where dynamic setting s working for read_only, please.

I copy in @Xiphware as he earlier mentioned read_only is working dynamically here:
Dynamic Constraint Message (Logic expression) >> post 3

Maybe this issue needs to be forwarded to development? @jnm
It is necessary to allow read_only to be set dynamically. Just an example: If a birth date is recorded, age can be calculated (set to read_only = yes), otherwise age has to be entered…

The finding might be related with this topic:

Thanks in advance.
Kind regards

Sorry, I misspoke - Enketo does not yet support runtime re-evaluating XPath read-only bindings. See (“Dynamic readonly”)

Actually, after a bit more digging, Enketo doesn’t actually evaluate the readony XPath expression (!). Rather, presently it just checks whether the string is “true()” or not. So, for example, if you put read_only as “1=1” - which is always true - it will not work as expected.

If interested, Enketo issue is being tracked here:

1 Like

you are welcome. @Xiphware: Also KoBoCollect does NOT support??
(Different to XLSForm spec.)…
Should be addressed to the developers, please. (Since Feb. no news there).

**I there a summary list, which standard XLSForm elements from the official spec ( are yet NOT implemented in KoBoCollect (or differently) **

Have a nice day.

Just to add: KoBoCollect works fine with dynamic read_only (following the XLSForm specification)…
@Xiphware I suggest to add a hint in the as it doesn’t explain the problem with Enketo, but says: “… or a statement that evaluates as true or false”.

The feature should be implemented for Enketo, as it’s useful, e.g. to preset a value and set the field to read_only dynamically, for example if the current person in a repeat is the head of household. Sorry, in general I would appreciate that features defined in the specification are fully implemented in KoBoCollect and Enketo. Or a complete list of current differences to the official spec should be provided.
Kind regards