Skip to content

Commit b0fd9e1

Browse files
authored
gpadvs-enable-add-new-option.js: Added new snippet.
1 parent efaba5e commit b0fd9e1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Gravity Perks // Advanced Select // Enable "Add New" Option
3+
* https://gravitywiz.com/documentation/gravity-forms-advanced-select/
4+
*
5+
* Enable Advanced Select's "Add New" option that allows users to create new items that aren't in the initial list of options.
6+
*
7+
* Instructions:
8+
*
9+
* 1. Install this snippet with our free Custom JavaScript plugin.
10+
* https://gravitywiz.com/gravity-forms-custom-javascript/
11+
*
12+
* 2. Enable "Allow field to be populated dynamically" option under your Advanced-Select-enabled field's Advanced settings.
13+
* NOTE: This step is not required if you are dynamically populating choices via Populate Anything.
14+
*/
15+
gform.addFilter( 'gpadvs_settings', function( settings, gpadvs ) {
16+
if ( gpadvs.formId == GFFORMID ) {
17+
settings.create = true;
18+
}
19+
return settings;
20+
} );

0 commit comments

Comments
 (0)