gform_list_item_pre_add

gform_list_item_pre_add

DescriptionUsageParametersExamples1. Reset Datepicker Input2. Set Column Input ValuePlacementSource Code

Description
This JavaScript hook can be used to filter new List Field rows before they are added.
Usage
1234gform.addFilter( 'gform_list_item_pre_add', function ( clone ) {    // do stuff    return clone;} );

Parameters

clone Javascript Object
The List Field table row.

group Javascript Object
The List Field table row before being cloned and the inputs cleared. Available from Gravity Forms 1.9.15.1.

Examples
1. Reset Datepicker Input
This example shows how you can reset a datepicker input so the datepicker will function on the new row.
1234567
2. Set Column Input Value
This example shows how you can set the value of the input in the second column of the new row.
123456
Placement
Your code snippet can be placed in a HTML field on your form or in a theme custom JavaScript file.
Source Code
This filter is located in js/gravityforms.js

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注