This appendix provides detailed technical specifications for the existing field types, validation methods, and behaviors that must be supported in the new Dynamic Form Builder implementation.
Field types define how data is stored in the database.
| Field Type | Description | Database Type |
|---|---|---|
text |
Single or multi-line text | String/Text |
integer |
Whole numbers | Integer |
decimal |
Decimal numbers | Decimal |
date |
Date values | Date |
datetime |
Date and time values | DateTime |
boolean |
True/false values | Boolean |
UI types define how fields are rendered and interact with users.
| UI Type | Description | Use Case |
|---|---|---|
text_field |
Standard single-line text input | Name, email, etc. |
hidden_field |
Hidden field not visible to users | System values, IDs |
numeric_field |
Numeric input with validation | Age, GPA, ID numbers |
check_box |
Multiple checkboxes | Multi-select options |
single_check_box |
Single checkbox | Yes/No, acceptance |
date |
Basic date input | Birth date, enrollment date |
date_picker |
Interactive date picker | User-friendly date selection |
date_picker_100_years_back |
Date picker with extended range | Birth dates for older adults |
radio_button |
Radio button group | Single selection from options |
drop_down |
Standard dropdown select | State, status selection |
multi_select |
Multiple selection dropdown | Multiple options |
select2 |
Enhanced Select2 component | Searchable, ajax-enabled selects |
The ValidationMethods module provides reusable validation logic that can be applied at both backend and frontend levels. This module should be leveraged in the new implementation.
Backend validations are executed server-side before data is saved.
| Method | Description | Format |
|---|---|---|
valid_ssn |
Basic SSN format | 123-45-6789 or 123456789 |
valid_ssn_strict |
SSN with blacklist check | Excludes common patterns (111111111, etc.) |
valid_legal_ssn |
Legal SSN validation | Validates against SSA rules |
| Method | Description | Format |
|---|---|---|
valid_email |
Email format validation | user@domain.com |
valid_iwcc_email |
Email excluding specific domain | Excludes @iwcc.edu |
valid_cell_phone |
Cell phone format | (123) 456-7890 or similar |
valid_phone_without_ext |
Phone without extension | Various formats supported |
valid_zipcode |
US and Canadian zip codes | 12345, 12345-6789, or A1A 1A1 |
| Method | Description | Pattern |
|---|---|---|
valid_eight_digit_m_number |
M followed by 8 digits | M12345678 |
valid_eight_digit_k_number |
K followed by 8 digits | K12345678 |
valid_eight_digit_s_number |
S followed by 8 digits | S12345678 |
valid_eight_digit_a_number |
A followed by 8 digits | A12345678 |
valid_eight_digit_w_number |
W followed by 7 digits | W1234567 |
valid_nine_digit_w_number |
W followed by 8 digits | W12345678 |
valid_nine_digit_j_number |
J followed by 8 digits | J12345678 |
| Method | Description | Pattern |
|---|---|---|
valid_nine_digit_number |
Exactly 9 digits | 123456789 |
valid_nine_digit_number_leading_900 |
9 digits starting with 900 | 900123456 |
valid_eight_digit_number |
Exactly 8 digits | 12345678 |
valid_seven_digit_number |
Exactly 7 digits | 1234567 |
valid_seven_digit_leading_zero_number |
7 digits starting with 0 | 0123456 |
valid_seven_digit_leading_three_number |
7 digits starting with 3 | 3123456 |
valid_six_to_eight_digit_no |
6 to 8 digits | 123456-12345678 |
valid_five_digit_number |
Exactly 5 digits | 12345 |
valid_four_digit_number |
Exactly 4 digits | 1234 |
valid_four_digit_pin |
4-digit PIN | 1234 |
| Method | Description | Allowed Characters |
|---|---|---|
only_letters_or_spaces |
Letters and spaces only | A-Z, a-z, space |
only_letters_or_hyphens_or_apostrophes |
Letters, hyphens, apostrophes | A-Z, a-z, -, ' |
only_letters_or_hyphens_or_spaces_or_apostrophes |
Letters with common punctuation | A-Z, a-z, -, ', space |
only_letters_or_numbers_or_spaces_or_periods |
Alphanumeric with periods | Requires both letters AND numbers |
only_letters_or_numbers_or_spaces |
Alphanumeric | Requires both letters AND numbers |
only_letters_or_numbers_or_spaces_or_hyphens |
Alphanumeric with hyphens | Requires both letters AND numbers |
proper_only_letters_or_numbers_or_spaces |
Proper alphanumeric | A-Z, a-z, 0-9, -, space |
only_mixed_case_letters |
Mixed case letters only | Must have both upper and lower |
only_mixed_case_letters_or_numbers_or_spaces |
Mixed case alphanumeric | Must have mixed case |
only_mixed_case_letters_or_hyphens_or_apostrophes_or_spaces |
Mixed case with punctuation | Must have mixed case |
only_mixed_case_letters_or_hyphens_or_spaces |
Mixed case letters with hyphens/spaces | Must have mixed case |
| Method | Description | Rules |
|---|---|---|
valid_name |
Proper name validation | Capital first letter, no titles/prefixes |
valid_gpa |
GPA validation (0-5 scale) | 0.00 to 5.00, up to 2 decimals |
valid_gpa_max_six |
GPA validation (0-6 scale) | 0.00 to 6.00 |
confirmation |
Field confirmation match | Must match another field value |
Frontend validations provide immediate user feedback in the browser. These largely mirror backend validations with some UI-specific additions.
Additional UI-Only Validations:
| Method | Description | Format |
|---|---|---|
valid_date |
Date format validation | Client-side date validation |
valid_us_birth_date |
US birth date validation | Valid US birth date format |
valid_date_with_age_range |
Date with age constraints | Birth date within age range |
valid_ssn_ivytech |
IvyTech-specific SSN | College-specific SSN rules |
valid_eight_digit_j_number |
J followed by 7 digits | J1234567 |
valid_eight_digit_h_number |
H followed by 7 digits | H1234567 |
Note: All backend validation methods listed in section 2.1 are also available for frontend validation except confirmation and valid_nine_digit_number_leading_900 in some cases.
- Reusable Module: The
ValidationMethodsmodule should be preserved and extended in the new implementation - Regex Conversion: The module includes
regexp_to_javascriptmethod to convert Ruby regexes to JavaScript for client-side validation - Consistent Validation: Same validation logic should apply on both frontend and backend for data integrity
- Extensibility: New validation methods can be added to the module following the established pattern
Behaviors define how fields interact with different user roles and application states. Currently, only one behavior per field is supported, but the new implementation should support multiple behaviors per field.
| Behavior | Description |
|---|---|
required |
Field must be filled out before submission |
| Behavior | Description | Use Case |
|---|---|---|
hide_in_application |
Hidden during application process | Internal/system fields |
| Behavior | Description | Affected Role |
|---|---|---|
hide_from_student_after_completion |
Hidden from student after application submitted | Student |
hide_from_high_school_after_completion |
Hidden from high school after completion | High School User |
hide_from_college_after_completion |
Hidden from college after completion | College User |
3.2.3 Role-Based Always Hidden
| Behavior | Description | Affected Role |
|---|---|---|
hide_from_student_always |
Never visible to students | Student |
hide_from_high_school_always |
Never visible to high school users | High School User |
| Behavior | Description | Use Case |
|---|---|---|
hide_from_student_until_populated_then_read_only |
Hidden until populated, then read-only for student | System-populated fields |
hide_from_high_school_until_populated_then_read_only |
Hidden until populated, then read-only for HS | System-populated fields |
| Behavior | Description | Use Case |
|---|---|---|
student_read_only_after_populated |
Student can't edit after value entered | Prevent changes to critical data |
student_read_only_if_ever_completed |
Student can't edit if application ever completed | Lock submitted data |
Current Implementation: Behaviors are stored as an array in the database, allowing for future multi-behavior support.
Methods Available:
behavior?(behavior)- Check if behavior is setset_behavior(behavior)- Add a behaviorclear_behavior(behavior)- Remove a behavioralter_behavior(behavior, value)- Toggle behavior based on value
New Implementation Requirement: Support multiple simultaneous behaviors per field (e.g., a field can be both required and hide_from_student_after_completion).
Optional CSS classes for field layout and styling.
| CSS Class | Description | Effect |
|---|---|---|
line-break-before |
Insert line break before field | Forces field to new row |
additional-space-before |
Add extra spacing before field | Visual separation |
right-justify |
Right-align field content | Numeric/currency fields |
| Attribute | Type | Description |
|---|---|---|
internal_name |
String | Unique identifier for the field (required) |
display_name |
String | Label shown to users (required) |
hint_text |
String | Help text/description shown near field |
placeholder |
String | Placeholder text inside input |
default_value |
String/JSON | Default value when field is created |
allowed_values |
JSON/Method | Array, hash, or helper method name for options |
maximum_length |
Integer | Maximum character length |
minimum_length |
Integer | Minimum character length |
display_size |
Integer | Display width for input field |
include_in_reports |
Boolean | Whether to include in exports/reports |
| Association | Description |
|---|---|
associated_field_id |
Link to related field for two-way association |
confirmation_field_id |
Field that must match this field's value |
api_option_id |
Link to API option for dynamic data loading |
- ✅ All current field types and UI types
- ✅ All backend and frontend validation methods from
ValidationMethodsmodule - ✅ Multiple behaviors per field (enhancement from current single behavior)
- ✅ All current field attributes and associations
- ✅ CSS class options for layout control
- ✅ Tooltips/hint text for field-level help
- ✅ Pattern for adding new field types without code changes
- ✅ Pattern for adding new validation methods
- ✅ Pattern for adding new behaviors
- ✅ Documentation for extending each component
- ✅ Leverage existing
ValidationMethodsmodule - ✅ Maintain compatibility with existing data structures
- ✅ Support both student applications and Active Flow workflows
Critical Requirement: A comprehensive, machine-readable dictionary of all field types, validations, and behaviors that serves as the single source of truth for both the UI and automated tools.
Purpose - Dual Consumption:
-
Human Consumption (Form Builder UI):
- Display available field types to users building forms
- Show applicable validations for each field type
- Present configurable behaviors with descriptions
- Provide help text and tooltips
- Enable intelligent form builder interface
-
Machine Consumption (Tools & Migration):
- Enable automated migration from fixture-based colleges
- Allow AI-powered tools to understand system capabilities
- Provide programmatic queryability
- Support validation and testing tools
The Dictionary Concept:
This isn't just documentation - it's the authoritative data source. The form builder UI doesn't have field types "hard-coded" - it reads them from the dictionary. When we add a new validation method, we add it to the dictionary, and both the UI and migration tools immediately understand it exists.
Similar to how local options work in the current system (centralized data configuration), the dictionary is a structured data source that defines the system's capabilities.
Key Characteristics:
-
Structured Data Format: Machine-readable format that can be queried programmatically
-
Comprehensive Coverage: All field types, UI types, validations, and behaviors defined with:
- Human-readable descriptions for UI display
- Compatibility rules (which validations work with which field types)
- Conflict rules (which behaviors can't be combined)
- Role-specific attributes where applicable
-
Version Controlled: Part of the codebase, updated when capabilities change
-
Queryable: The form builder UI queries it to populate dropdowns and configurators; migration tools query it to validate mappings
-
Self-Documenting: Descriptions in the dictionary serve as both UI help text and technical documentation
Usage Scenarios:
In the Form Builder UI: When a user drags a text field onto their form and clicks to configure validations, the UI shows only validations that apply to text fields - populated from the dictionary. Tooltips and help text come from the dictionary descriptions.
In Migration Tools: When analyzing custom code that uses email validation on a text field, the tool queries the dictionary to confirm this is a supported combination before creating the mapping.
Deliverable Requirements:
- Dictionary data in a structured, machine-readable format (vendor's choice of implementation)
- Programmatic interface for querying dictionary contents
- UI components that consume the dictionary to drive field pickers, validation selectors, and behavior configurators
- Documentation on extending the dictionary when new capabilities are added
- Validation mechanism to ensure dictionary accurately reflects implemented capabilities
# Example from ValidationMethods module that should be preserved
def valid_email(email)
return true unless email.present?
!!(email =~ /\A[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\z/)
end
# JavaScript conversion for frontend validation
regexp_to_javascript(/\A[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\z/)
# => "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"The new form builder must maintain compatibility with existing data:
- ApplicationField records and their attributes
- ApplicationFieldValue records storing student data
- ApplicationFieldGroup organization
- Existing fixture files during migration period
- Backwards compatibility mode for colleges not yet migrated
These are potential future additions that should be considered in the architecture but not required for initial delivery:
- Rich text editor field type
- File upload with preview and drag-drop
- Digital signature capture
- Calculated/computed fields
- Conditional field visibility based on complex rules
- Field dependency visual mapping
- Custom regex validation builder
- Multi-step form wizards with progress indicators
- Field templates/presets for common patterns
Document Version: 1.0 Last Updated: 2025-10-04 Related Document: Request for Proposal - Dynamic Form Builder for Student Applications