Skip to main content

Form Validator

Use this attribute-based validation system on Webflow to handle multiple forms with email blocking, country-aware phone validation, and real-time feedback. It dynamically checks business email domains and country codes, stays up to date automatically, and works smoothly with light and dark themes.

1. Add this <script> inside the <head> tag of your page or project

Script to include once per page
<script src="https://cdn.jsdelivr.net/gh/Everything-Design/everythingflow@main/Tools/Validation-form.js"></script>

2. Add this attribute to the form block

Unique name for this form
ef-form-div="your-form-name"

** It should be unique per form

3. Add this theme attribute to the form block to set the theme.

Attribute for Light Theme
ef-form-theme="light"
Attribute for Dark Theme
ef-form-theme="dark"

Use ef-form-theme="light/dark" to choose the theme.

**Apply this attribute to the element having attribute ef-form-div="your-form-name"

4. Add these attributes to the form inputs

Add this attribute for plain text
ef-form-input="plain"
Add this attribute for business email and email
ef-form-input="business email"
Email input
ef-form-input="email"
Add these attributes for Phone number
ef-form-input="phone"

**Apply this attribute to the Input elements in the forms

**Apply this attribute to the Input elements having business email input in the forms

**Apply this attribute to the Input elements having email input in the forms

**Apply this attribute to the Input elements having phone input in the forms

5. Add these attributes to the input should be required

Required field
ef-data-required="required"

**Apply this attribute to the element having attribute ef-form-input="attribute value"

6. Add these attributes for the validation svg's or image

Add these for right attribute
ef-form-val="right"
Add this for wrong attribute
ef-form-val="wrong"

**Apply this attribute to the element which can be image or svg embed

7. Add these attributes for form buttons

Submit button
ef-form-submit="Any name"

**Apply this attribute to the form button

8. Add these attributes to select field (Optional)

Country-code select
ef-form-select="Country Code"

**Apply this attribute to the select element

9. Add these attribute for inputs to change their color on border or background (Optional)

Add these for background color change
ef-bg="validation"
Add these for border color change
ef-bd="validation"

**Apply this attribute to the the element having attribute ef-data-required ="required"

10. Add country auto-select (Optional)

IP-based country auto-select (phone)
ef-geo="location"
IP-based country name auto-select
ef-geo="country-name"

**Apply this attribute to the the element having attribute ef-form-select ="Country Code"

**Country name eg="India", "United States", **This is to avoid changing country code based on geo location