內容簡介
外掛總結:這個外掛為每個欄位提供即時反饋和指引,幫助防止錯誤,減少表單提交時間,並確保提交的資料準確完整。它引入了動態交互驗證的方式,在用戶填寫表單時即時驗證輸入的資料。
特點:
- 可以針對每個 Gravity Forms 啟用/關閉功能。
- 只對必填欄位進行驗證。
- 可自訂驗證提示訊息。
- 適用於多步驟表單。
- 適用於 AJAX / 非 AJAX 環境。
- 支援欄位的條件邏輯。
- 可在同一頁面上使用多個表單。
- 更多功能即將推出。
可用於以下欄位:
- 單行文字
- 段落文字
- 下拉選單
- 數字
- 多選框
- 單選按鈕
- 姓名
- 日期
- 時間
- 電話號碼
- 地址
- 網址
- 電子郵件
- 產品
- 數量
- 選項
- 運送方式
- 更多即將推出。
需求:
- PHP 7.4
- Gravity Forms 2.6.0、2.7.0 或以上版本
使用 HTML 項目清單呈現上述內容:
<ul>
<li>外掛總結:這個外掛為每個欄位提供即時反饋和指引,幫助防止錯誤,減少表單提交時間,並確保提交的資料準確完整。它引入了動態交互驗證的方式,在用戶填寫表單時即時驗證輸入的資料。</li>
<li>特點:
<ul>
<li>可以針對每個 Gravity Forms 啟用/關閉功能。</li>
<li>只對必填欄位進行驗證。</li>
<li>可自訂驗證提示訊息。</li>
<li>適用於多步驟表單。</li>
<li>適用於 AJAX / 非 AJAX 環境。</li>
<li>支援欄位的條件邏輯。</li>
<li>可在同一頁面上使用多個表單。</li>
<li>更多功能即將推出。</li>
</ul>
</li>
<li>可用於以下欄位:
<ul>
<li>單行文字</li>
<li>段落文字</li>
<li>下拉選單</li>
<li>數字</li>
<li>多選框</li>
<li>單選按鈕</li>
<li>姓名</li>
<li>日期</li>
<li>時間</li>
<li>電話號碼</li>
<li>地址</li>
<li>網址</li>
<li>電子郵件</li>
<li>產品</li>
<li>數量</li>
<li>選項</li>
<li>運送方式</li>
<li>更多即將推出。</li>
</ul>
</li>
<li>需求:
<ul>
<li>PHP 7.4</li>
<li>Gravity Forms 2.6.0、2.7.0 或以上版本</li>
</ul>
</li>
</ul>
外掛標籤
開發者團隊
② 後台搜尋「Real Time Validation For Gravity Forms」→ 直接安裝(推薦)
原文外掛簡介
Real Time Validation For Gravity Forms checks every field the moment a user leaves it, instead of waiting for the form to be submitted. Mistakes are shown right below the field, so users fix them on the spot.
The result: fewer failed submissions, faster form completion and cleaner, more accurate data.
✨ Features
Instant feedback – errors appear as soon as a field loses focus.
Regular expression validation – add your own pattern and error message to Text and Number fields.
Repeater field support – works on every row, including rows added with “Add Row”. (New in 1.0.5)
Per form switch – turn real time validation on or off for each form.
Custom messages – uses each field’s custom validation message when set.
Multi-step forms – works on every page of a multi-page form.
AJAX and non-AJAX – works in both modes.
Conditional logic – plays nicely with fields shown or hidden by conditional logic.
Multiple forms – supports several forms on the same page.
🧩 Supported fields
Standard: Single Line Text, Paragraph Text, Drop Down, Number, Checkboxes, Radio Buttons, Image Choice, Multiple Choice
Advanced: Name, Date, Time, Phone, Address, Website, Email, Consent, Repeater
Pricing: Product, Quantity, Option, Shipping
More fields are coming soon.
🔍 Regular expression validation
Regular expressions are available for Single Line Text and Number fields. The same pattern is checked in the browser while typing and again on the server when the form is submitted.
How to set it up
Open the form editor and select a Single Line Text or Number field.
Go to the Advanced tab and check Enable Real Time Validation.
Enter your pattern in Enter RegEx pattern.
Enter the message to show when the value does not match in Validation failed message. If left empty, “Validation Failed.” is shown.
Pattern format
Write the pattern on its own, for example ^[A-Z]{3}$.
Optionally wrap it in slashes to add flags, for example /^[a-z]{3}$/i for a case-insensitive match. Supported flags: i, m, s, u.
A / inside the pattern is fine, for example ^\d{2}/\d{2}$.
Use ^ and $ to match the whole value. Without them the pattern only has to match part of it.
If the field is not required, an empty value is accepted. The pattern is only checked once something is entered.
Examples
Copy only the pattern itself, without the surrounding backticks.
Phone number: ^(\+?\d{1,4}[\s-]?)?(\(?\d{3,4}\)?[\s-]?)?\d{3}[\s-]?\d{3,4}$
Only letters and spaces: ^[A-Za-z ]+$
Exactly 5 digits (ZIP code): ^\d{5}$
Date as DD/MM/YYYY: ^\d{2}/\d{2}/\d{4}$
Starts with “INV-” (any case): /^inv-\d+$/i
📋 Requirements
PHP 7.4 or higher
Gravity Forms 3.0.0 or higher
🚀 Our other plugins
Alpha Addons for Gravity Forms
Smart Phone Field for Gravity Forms
Smart Phone Field for Fluent Forms
Smart Phone Field for Contact Form 7
Smart Phone Field for Elementor Form
Image Picker for Gravity Forms
Range Slider for Gravity Forms
Address AutoComplete for Gravity Forms
Restrict Dates for Gravity Forms
