How to add a rule for a specific form field

Using the context menu of the form field

Autofill Forms makes it easy to add a rule for a specific form field:

  • Visit the website containing the form, e.g. http://autofillforms.mozdev.org/test.html
  • Fill out the form field with the desired value.
  • Invoke the context menu of the form field (e.g. by clicking with the right mouse button on the form field).
  • Select the menu item "Add a rule for this field..." from the context menu.

Autofill Forms Advanced Editor will be opened, displaying the current profile.
The text fields at the bottom of the rules listing display the Name, Value, Field Rule and Site Rule for the new rule.
Select the profile you want to add the rule to and then click on the button labeled "Add" to add the new rule to this profile.

Note that the Site Rule of the new rule is automatically set to match only the website containing the form.

Manually creating a new rule using the "Display form details" feature

Sometimes it's not possible to use the context menu of a form field to add a new rule.

You may also create a new rule manually the following way:

  • Visit the website containing the form, e.g. http://autofillforms.mozdev.org/test.html
  • Invoke the context menu of the webpage (e.g. by clicking with the right mouse button somewhere on the webpage - but not on a form field).
  • Selecte the menu item "Display form details" from the context menu.

This will display the "name" attributes and the values of all form fields on the webpage.

You may also adjust the style used to display this information via the View settings.
It is also possible to use a Keyboard Shortcut or to assign Mouse Buttons for the "Display form details" feature.
To hide the form details, just invoke the "Display form details" command again.

To create an Autofill Forms rule using the form details information, copy the name attribute of the form field.
e.g. if the form details display name="username" you only need to copy the word "username" (without quotes).

Now open up the Advanced Editor and fill out the text input fields at the bottom of the rules listing:

  • Choose a Name for your rule.
  • Set the Value your rule should fill out, e.g. to your standard username.
  • Set the Field Rule to "username" (without quotes). You may also use the Rule Editor for a more fine-grained Field Rule.
  • Set the Site Rule using the Rule Editor or keep it empty (which will result to the standard Site Rule.

Select the profile you want to add the rule to and then click on the button labeled "Add" to add the new rule to this profile.

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.