📋 Form Validation Example

Real-time validation with Stimulus + Opal

User Registration

We'll check if this email is available
Letters and numbers only, 4-20 characters
At least 8 characters with uppercase, lowercase, and number
Must be 18 or older

Validation Stats

Total Fields: 0
Valid Fields: 0
Invalid Fields: 0
Form Valid: No

✨ Features Demonstrated

📝 Real-time Validation

Validates fields on blur and clears errors on input

🔍 Multiple Rules

Required, min/max length, email, URL, phone, password strength

⚡ Async Validation

Email availability check with simulated API call

🎯 Field Matching

Password confirmation matching

📊 Live Stats

Track validation state in real-time

💬 Custom Messages

User-friendly error messages for each rule