Field Types¶
Advanced Forms provides a rich set of field types to capture various kinds of data. Each field type has specific configuration options and validation rules.
Text Fields¶
Text Field (Single-line)¶
- Purpose: Basic text input for names, titles, short answers.
- Validation Options:
- Plain: Accepts any text.
- Email: Validates using standard email regex.
- Phone: Validates standard phone number formats.
- URL: Validates web addresses.
- Configuration:
- Max Length: Restrict the number of characters.
Long Text Field (Multi-line)¶
- Purpose: Large text areas for comments, essays, or detailed descriptions.
- Configuration:
- Max Length: Enforce a character limit (useful for "200 words or less" type questions).
- Rows: Control the default height of the input box.
Hidden Field¶
- Purpose: Store data that needs to be submitted with the form but not seen or edited by the user.
- Use Cases:
- Storing a campaign ID passed via URL.
- Tracking a referral source.
- Holding a calculated value from a workflow (if pre-filled).
- Behavior: The field is rendered in the DOM as
type="hidden"and its value is included in the submission.
Selection Fields¶
Radio Buttons¶
- Purpose: Single selection from a visible list of options. Best for small lists (2-5 options).
- Options Source:
- Custom: Define options manually in the form builder (Value + Text).
- Defined Type: Pull options dynamically from a Rock Defined Type (e.g., "Marital Status").
- Validation: User must select exactly one option if required.
Dropdown¶
- Purpose: Single selection from a collapsed list. Best for long lists (States, Countries).
- Options Source: Supports both Custom and Defined Types.
- Features: Includes a search/filter box for easy selection in long lists.
Checkboxes¶
- Purpose: Multiple selections from a list.
- Data Storage: Selected values are stored as a comma-separated string (e.g., "Red,Blue,Green").
- Validation: "Required" means the user must select at least one option.
Special Fields¶
Date Field¶
- Purpose: Date picker input.
- Validation: Ensures the input is a valid date.
- Range: Dates beyond the year 3000 are rejected.
- Logic: Can be used in "Greater Than" / "Less Than" conditions (e.g., "Show parent guardian fields if Date of Birth is less than 18 years ago").
File Upload¶
- Purpose: Allow users to upload documents, images, or other files.
- Configuration:
- Binary File Type: Link to a Rock Binary File Type to control allowed extensions and storage location.
- Storage: Files are uploaded to Rock's BinaryFile system and linked to the form entry.
Address Field¶
- Purpose: A composite field capturing a complete physical address.
- Structure: Captures 7 distinct data points:
- Street 1, Street 2
- City, County, State, Country, Postal Code
- Validation: Integrates with Rock's address validation rules (based on Country selection).
- Logic: Supports specialized operators like "State Is" or "Country Is" for location-based conditional logic.
HTML Content¶
HTML Element¶
- Purpose: Display static content, not an input field.
- Use Cases:
- Section headers or instructions.
- Rich text descriptions.
- Embedded images or videos.
- Lava-rendered content (displaying user's name or pre-filled data).
- Configuration: Full rich text editor support.