gppa_should_trigger_change (JS)
Description
Override when fields and Live Merge Tag values are refreshed when dependent inputs change.
A common use of this filter is to require a certain number of characters in inputs before triggering an update.
Usage
gform.addFilter( 'gppa_should_trigger_change', 'my_custom_function' );
Parameters
triggerChange boolean
Whether or not to trigger update of fields and Live Merge Tags. Default:
true
formId string
The current form ID.
inputId string
The ID of the input that had a change event triggered.
$el JQuery
Input element that had change event.
event JQueryEventObject
Original event on input.
Examples
Require input to have at least 4 characters before triggering a change.
/**
* Gravity Perks // Populate Anything // Require a Minimum Character Count Before Triggering a Change
* https://gravitywiz.comhttps://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-code-chest/
*/
window.gform.addFilter('gppa_should_trigger_change', function( triggerChange, formId, inputId, $el, event ) {
// Update "1" to the field ID.
if ( inputId == 1 ) {
// Require length for input 1 to be at least 4.
if ( event.currentTarget.value.length < 4 ) {
return false;
}
}
return triggerChange;
} );
Since
This JavaScript filter is available since Gravity Forms Populate Anything 1.0-beta-5.20.
All Connections
All Perks
- GF Address Autocomplete
- GF Advanced Calculations
- GF Advanced Phone Field
- GF Advanced Save & Continue
- GF Advanced Select
- GF Auto List Field
- GF Auto Login
- GF Better User Activation
- GF Blocklist
- GF Bookings
- GF Conditional Logic Dates
- GF Conditional Pricing
- GF Copy Cat
- GF Date Time Calculator
- GF Disable Entry Creation
- GF Easy Passthrough
- GF eCommerce Fields
- GF Email Users
- GF Email Validator
- GF Entry Blocks
- GF Expand Textareas
- GF File Renamer
- GF File Upload Pro
- GF Inventory
- GF Limit Checkboxes
- GF Limit Dates
- GF Limit Submissions
- GF Live Preview
- GF Media Library
- GF Multi-Page Navigation
- GF Nested Forms
- GF Notification Scheduler
- GF Page Transitions
- GF Pay Per Word
- GF Populate Anything
- GF Post Content Merge Tags
- GF Preview Submission
- GF Price Range
- GF QR Code
- GF Randomizer
- GF Read Only
- GF Reload Form
- GF Submit to Access
- GF Terms Of Service
- GF Unique ID
- GF Word Count