Extension:AutoFillFormField

The AutoFillFormField extension allows to automatically fill form input fields provided by the Semantic Forms extension based on the (live) input of other fields.

Rationale
In some situations, choosing the correct page name is difficult, since there are many possibilities how to do it. This leads to inconsistencies, duplicated pages etc. This extension is an attempt to solve this problem when using Semantic Forms in edit mode.

It allows to define a field that holds the final page URL, providing a pattern how to build it. This pattern can create references to other fields, whose in-put values will be incorporated while typing.

Installation
Instead of downloading the tarball you may also check this extension out via Git:

Usage
AutoFillFormField is triggered by applying certain CSS classes to fields in your Semantic Form.

Target Field
First you have to define the target field by applying the  class to it. The field also needs to declare how the URL / name is built. This is done by adding a second class starting with  followed by a string that declares how the field value needs to be built.

This string supports variables and substitutions. Variables are encapsulated in ? signs, like.

Currently the following substitutions are supported:
 * to  (space). This is important because you can't add spaces to a classname.
 * will be substituted by the current full pagename.

Examples:

Source Fields
A source field is defined by adding the class AutoFillFormFieldSource and the variablename prefixed by. Example:.

Every field that is referenced by a ?variable? needs a corresponding source_target.

Semantic Form Markup
The important parts are marked in bold.

Result
This is how the code above will look look / behave: