Field Rule
To fill out a form, Autofill Forms matches the rules of the current profile against the form fields.
The Field Rule defines which form fields are filled out by a rule.
Field Rules are written as Regular Expressions and matched against
- the "name" attribute of the form field, and if it doesn't match against
- the label assigned to the form field (see also Advanced Settings on which elements are used as labels).
If the "name" attribute is not set or empty, the Field Rule is also matched against the "id" attribute of the form field.
If position matching is enabled (see Advanced Settings), the Field Rule is also matched against the position of the form field.
If the Field Rule does not match against any of the above, the next Field Rule in the Profile is matched against the form field.
If the Field Rule matches, it is added to a list of Alternatives. Autofill Forms continues in the list of rules of the current Profile and adds all subsequent rules that match as well. As soon as a rule does not match this iteration is stopped.
If only one Alternative has been collected, it is used as selected rule to fill out the current form field. If several Alternatives have been collected, a selection dialog is displayed. The selected rule is used to fill out the current form field.
If the form field is a text input field, the value of the text input field is set to the value of the selected rule (see also Advanced Editor).
If the form field is a selection, radio button or checkbox, the value of the rule is matched as Regular Expression (see Regular Expressions) against the value of the form field, or in case of selections against the values of the selection options. If the match succeeds, the form field or the form field options are checked/selected or unchecked/deselected, depending on the "Overwrite" setting of the rule (see also Advanced Editor).
Note that the order of the rules of a profile is important. Apart from Alternatives only the first matching rule is used on a form field. So it's best to put more specific rules up and more general rules down in the list.
