The lightning-record-edit-form
is very clever, but so far I've found it useful only for reasonably default (and static) behaviour that can be defined in a layout.
I need to build a form where the values in some fields will affect the behaviour of other fields in the form. e.g. selecting a certain value in one field may determine whether other fields are required or editable, or disabled, or have a different set of validation rules applied to them.
When using Angular and other frameworks, there were built-in ways to dynamically set the behaviour of an element (e.g. with ng-required, ng-disabled etc) and based on those behaviours if the element and the form as a whole were valid.
Are there similar ways to dynamically configure the behaviour of form elements?
And is determining if a custom form is valid best done by selecting all of the elements (e.g. by class) and call checkValidity()
on each element?
Thanks