gform_list_post_item_add

Description

The gform_list_post_item_add JavaScript action in Gravity Forms is fired after a new item is added to a List field, allowing further actions to be performed.

Usage

gform.addAction( 'gform_list_post_item_add', function ( item, container ) {
	// do stuff
} );

Parameters

ParameterTypeDescription
itemJavascript ObjectThe List Field table row.
containerJavascript ObjectThe List Field table.

Examples

1. Bind Event To List Item Input

This example shows how you can bind a change event to the new list item input.

<script>
gform.addAction( 'gform_list_post_item_add', function ( item, container ) {
	item.find( 'input[type="text"]' ).on( 'change', function() {
		console.log( 'Changed!' );
	} );
} );
</script>

Placement

Reference the article Adding JavaScript Code to the Frontend of Your Site.

Source Code

This filter is located in js/gravityforms.js