Input fields

The miniform module will allow you to add any field you like to a form by simply adding the field in the template.

There are some simple rules about fields and fieldnames to tell the module it should be used as a form field and if it is a required field.

A standard inputfield will look something like this:

<input type="text" name="company" value="" />

To tell the module the field should be used in the mail that is sent we need to prefix the field with "mf_"
So, if you want the Company name to be included in the mail, the inputfield must be:

<input type="text" name="mf_company" value="" />

A second prefix is used to tell the module a field is required. To make a field required we need to add "r_" to the name.
So, if you want the Company name to be mandatory, the inputfield must be:

<input type="text" name="mf_r_company" value="" />

If a form is partly completed and reloaded because not all fields are filled, it is nice to have any content that is already available being filled in the inputfields again.
To do this we can use the fieldname in capitals between curly brackets.
So, if you want fill any previous content in the company field, the inputfield must be:

<input type="text" name="mf_r_company" value="{COMPANY}" />

To tell if a required field is not filled, a special class can be added that will allow you to use CSS to style the field as being in error. The class added will be named "missing"

<input class="{COMPANY_ERROR}" type="text" name="mf_r_company" value="{COMPANY}" />