Making fields mandatory

We are working on a project where we have a generic Adapter, used my many different forms and need some way to make some of the fields mandatory.

We have put regular expressions in the fields ([0-9][0-9] for example) and they validate that the field has exactly two digits (in this case) but the validation also allows the field to be empty.

How can I make sure that the field is not empty and is valid.

Now to make things more complicated, some parts of the forms can be hidden (using ITRs with visible props) and in this case, the hidden fields should be ignored (not validated).

Any ideas would be appreciated.


…currently no chance to declaratively define. Your adapter must cope with mandatory fields. You say, that you have a generic adapter - this could simplify the creation of a light-server-side framework to check mandatory input.

THe regular expressions you mention are only executed when the user actively changes the content.