Description
JavaScript event that triggers when any pricing field is modified.
Note: This event replaces the gform_price_change
filter.
Usage
document.addEventListener( 'gform/products/product_field_changed', function( event, formId, fieldId ) {
// Custom logic here.
});
Parameters
- data Javascript Object
Examples
Show an alert when the price is updated in a field.
document.addEventListener( 'gform/products/product_field_changed', function( event, formId, fieldId ) {
if (event.detail.fieldId == 1) {
alert('Price updated');
}
});
Placement
Reference the article Adding JavaScript Code to the Frontend of Your Site.
Source Code
This filter is located in assets/js/src/theme/fields/product/products.js
Since
The event was added in Gravity Forms 2.9.1