[WordPress] 外掛分享: Gravity Forms HTML5 Validation

首頁外掛目錄 › Gravity Forms HTML5 Validation
WordPress 外掛 Gravity Forms HTML5 Validation 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
1,000+
安裝啟用
★★★★★
5/5 分(3 則評價)
3635 天前
最後更新
問題解決
WordPress 3.5+ v2.4.2 上架:2014-08-27

內容簡介

此外掛為Gravity Forms外掛新增原生HTML5驗證支援。

支援標準與分頁表單。

支援標準欄位

單行文字
段落文字
下拉式清單
多選清單
核取方塊
數字
單選按鈕

支援進階欄位

姓名
日期
時間
電話
地址
網站
使用者名稱
密碼
電子郵件
檔案上傳

支援文章欄位

標題
內文
摘要
標籤
分類
文章圖片
自訂欄位

支援價格欄位

產品
數量
信用卡

支援掛鉤

gform_name_prefix_required
gform_name_middle_required
gform_name_suffix_required
gform_address_street2_required

這些掛鉤可用於這些子欄位上強制使用HTML5驗證。

使用範例:

以下會套用您的函數到所有表單。
add_filter( ‘gform_name_prefix_required’, ‘your_function_name’, 10, 2 );

如需針對特定表單,請附加表單ID到掛鉤名稱。(格式:gform_password_FORMID)
add_filter( ‘gform_name_prefix_required_6’, ‘your_function_name’, 10, 2 );

返回值預期為布林值; 因此您也可以用“__return_true”來使用它們。
add_filter( ‘gform_address_street2_required’, ‘__return_true’ );

需求

此外掛需要先安裝及啟用Rocketgenius的Gravity Forms外掛1.9版本及以上版本。

已測試

截至Gravity Forms外掛1.9.17.6版本。

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.4.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Gravity Forms HTML5 Validation」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Adds native HTML5 validation support to the Gravity Forms plugin.
It supports both standard and paginated forms.
Supported Standard Fields

Single Line Text
Paragraph Text
Drop Down
Multi Select
Checkboxes
Number
Radio Buttons

Supported Advanced Fields

Name
Date
Time
Phone
Address
Website
Username
Password
Email
File Upload

Supported Post Fields

Title
Body
Excerpt
Tags
Category
Post Image
Custom Field

Supported Pricing Fields

Product
Quantity
Credit Card

Supported Hooks

gform_name_prefix_required
gform_name_middle_required
gform_name_suffix_required
gform_address_street2_required

These hooks can be used to force html5 validation on these subfields.
Example usage:
The following would apply your function to all forms.
add_filter( ‘gform_name_prefix_required’, ‘your_function_name’, 10, 2 );
To target a specific form append the form id to the hook name. (format: gform_password_FORMID)
add_filter( ‘gform_name_prefix_required_6’, ‘your_function_name’, 10, 2 );
The return value is expected to be a boolean value; As such you can also use them with “__return_true”.
add_filter( ‘gform_address_street2_required’, ‘__return_true’ );
Requirements
This plugin requires prior installation and activation of Gravity Forms plugin by Rocketgenius ver. 1.9 and above.
Tested
Up to Gravity Forms plugin ver. 1.9.17.6

延伸相關外掛

文章
Filter
Apply Filters
Mastodon