The "Form field string" is a text string that is used to determine which fields are displayed on the dynamic form. The string must be in the order of <field>:<field>:<field>. Note the separation by colons.
The individual fields (except for type "radio", as defined later) must be of the form {require;}Name;type{;default}. Note the separation by semicolons. Also, note that the curly brackets indicate an optional field. If a field must be filled in to complete the form then the word "require" must appear at the start of the field definition (without the curly backets).
Fields of different types are available. Currently these types are supported:
- text - standard text box; Example: "Name;text"
- checkbox - A checkbox; Example: "Check Box;checkbox;Name displayed after checkbox,checked"
- radio - A group of radio buttons; Example: "Radio Button;radio;Yes,yes|No,no,checked"
- hidden - A hidden field; Example: "hiddendata;hidden"
- password - A password field. Note, this does not check the password against anything and it is included in the email in plaintext; Example: "require;Preferred Password;password"
- textarea - A large, multiline text area; Example: "Label;textarea"
- select - A dropdown box; Example: "Drop Down;select;Yes,yes|No,no,selected"
To indicate a default value for a field, you simply add an additional definition with that default. The only valid default for type "checkbox" is "checked".
The type "radio" uses a field definition such as this: {require;}Name;radio;Name1,Value1|Name2,Value2{,checked}. Note the additional definition of options, where the options themselves are separated by a pipe character (|), and each option has a name, a value, and an option default of checked.
Examples (the quotation marks are for clarity and are not required):
- Replicating the default form:- "require;Name;text:require;Email;text:require;Homepage;text:require;Message;textarea"
- A text field labeled for phone numbers:- "Phone number;text"
- A required text field labeled for phone numbers:- "require;Phone number;text"
- A textarea with default text:- "Default text;textarea;This is default text. It is boring. But it is default."
- A yes/no radio button:- "Radio Button;radio;Yes,yes|No,no,checked"
- A checkbox, checked by default:- "Check Box;checkbox;checked"
- The last four together:- "require;Phone number;text:Default text;textarea;This is default text. It is boring. But it is default.:Radio Button;radio;Yes,yes|No,no,checked:Check Box;checkbox;checked"
');
?>