How to lock a field in an HFE Registration form?

Hey O2 Form Expert friends @ball @mogoodrich - our friends at @ICRC are looking for a way to lock a field on a registration form so users can’t edit it: E.g. in this case, the Odoo ID field is populated automatically, and one doesn’t want the user to change it.

Example:

Do you know how they’d set this? :pray:

@grace They should use a lookup to show (but it does not allow edit):

https://openmrs.atlassian.net/wiki/spaces/docs/pages/25476979/HTML+Form+Entry+Module+Reference#HTMLFormEntryModuleReference-<lookup>

This is an example:

<lookup expression="patient.getPatientIdentifier(5)"/> this will get the patient's first identifier with Identifier Type Id of 5
1 Like

The registration app in O2 is not a HFE form at all, but it’s own thing, with it’s own configuration. Might be worth checking the docs. In this case, HTML input elements have a readonly attribute that makes the field uneditable. It seems like the underlying component has some way to set other attributes, so if you could get config.otherAttributes there to include readonly: true that would probably do it.

1 Like

Thank you very, very much Ian and Ellen for these fast and helpful answers! <3

1 Like