Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated all references to String.prototype.format() to use String.prototype.gformFormat() as the former is removed in Gravity Forms 2.8. #737

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions experimental/gw-capture-filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ var uploadFieldId = 4;
var targetFieldId = 5;
var template = '{filename}';

var $uploadField = $( '#input_GFFORMID_{0}'.format( uploadFieldId ) );
var $targetField = $( '#input_GFFORMID_{0}'.format( targetFieldId ) );
var $uploadField = $( '#input_GFFORMID_{0}'.gformFormat( uploadFieldId ) );
var $targetField = $( '#input_GFFORMID_{0}'.gformFormat( targetFieldId ) );

$uploadField.on( 'change', function() {
var filename = $( this ).val().split("\\").pop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
* https://gravitywiz.com/gravity-forms-custom-javascript/
*/
$( '#gform_GFFORMID input:checkbox' ).on( 'change', function () {
var _GFCalc = rgars( window, 'gf_global/gfcalc/{0}'.format( GFFORMID ) );
var _GFCalc = rgars( window, 'gf_global/gfcalc/{0}'.gformFormat( GFFORMID ) );
_GFCalc.runCalcs( formId, _GFCalc.formulaFields );
} );
10 changes: 5 additions & 5 deletions gp-auto-list-field/gpalf-dynamic-row-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* Gravity Perks // Auto List Field // Dynamic Row Labels for List Fields
* https://gravitywiz.com/documentation/gravity-forms-auto-list-field/
*
* Dynamically populate the first column of a List field with a dynamic value that includes the row number.
* Dynamically populate the first column of a List field with a dynamic value that includes the row number.
* For example, if your List field represents attendees to an event, you could label each row, "Attendee #1,
* Attendee #2, etc).

* Instructions:
*
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-custom-javascript/
* 2. Update variables to match your form by following the inline instructions.
Expand All @@ -30,11 +30,11 @@ function gw_apply_list_field_value_template( $container, $row ) {
$( this )
.find( 'input' )
.eq( 0 )
.val( template.format( rowIndex + 1 ) );
.val( template.gformFormat( rowIndex + 1 ) );
} );
}

gw_apply_list_field_value_template( $( '#field_GFFORMID_{0}'.format( listFieldId ) ) );
gw_apply_list_field_value_template( $( '#field_GFFORMID_{0}'.gformFormat( listFieldId ) ) );

gform.addAction( 'gform_list_post_item_add', function ( $row, $container ) {
if ( gf_get_input_id_by_html_id( $container.parents( '.gfield' ).attr( 'id' ) ) == listFieldId ) {
Expand Down
6 changes: 3 additions & 3 deletions gp-conditional-pricing/gpcp-show-original-price.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
return;
}

var $input = $( '#input_{0}_{1}'.format( GWConditionalPricing._formId, productId ) );
var $input = $( '#input_{0}_{1}'.gformFormat( GWConditionalPricing._formId, productId ) );
if ( ! $input.length ) {
return;
}

var $basePrice = $( '#base_price_{0}_{1}'.format( GWConditionalPricing._formId, productId ) );
var $basePrice = $( '#base_price_{0}_{1}'.gformFormat( GWConditionalPricing._formId, productId ) );

// Remove base price if there is no discounted price.
if ( $input.text() === basePrice ) {
$basePrice.remove();
}
// Otherwise, add base price if it has not been added.
else if ( ! $basePrice.length ) {
$basePrice = '<span id="base_price_{0}_{1}" style="text-decoration:line-through;margin-right:0.3rem">{2}</span>'.format( GWConditionalPricing._formId, productId, basePrice );
$basePrice = '<span id="base_price_{0}_{1}" style="text-decoration:line-through;margin-right:0.3rem">{2}</span>'.gformFormat( GWConditionalPricing._formId, productId, basePrice );
$input.before( $basePrice );
}

Expand Down
2 changes: 1 addition & 1 deletion gp-copy-cat/gpcc-clear-values-by-trigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
gform.addFilter( 'gpcc_copied_value', function( value, $targetElem, field ) {
// Update "4" to the field ID of your choice-based trigger field.
var triggerFieldId = 4;
if ( triggerFieldId == field.trigger && jQuery( '#choice_{0}_{1}_1'.format( field.targetFormId, triggerFieldId ) ).is( ':checked' ) ) {
if ( triggerFieldId == field.trigger && jQuery( '#choice_{0}_{1}_1'.gformFormat( field.targetFormId, triggerFieldId ) ).is( ':checked' ) ) {
value = '';
}
return value;
Expand Down
2 changes: 1 addition & 1 deletion gp-date-time-calculator/gpdtc-format-hours-mins.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function output_script() {
var hours = Math.floor( result );
var diff = hours - result;
var mins = Math.round( Math.abs( diff * 60 ) );
result = '{0} hours, {1} minutes'.format( hours, mins );
result = '{0} hours, {1} minutes'.gformFormat( hours, mins );
}
return result;
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ function gwizDebounce(func, wait, immediate) {
};
}

$(document).off("gform_post_conditional_logic.gfCalc_{0}".format(GFFORMID))
$(document).off("gform_post_conditional_logic.gfCalc_{0}".gformFormat(GFFORMID))

$(document).on("gform_post_conditional_logic.gfCalc_{0}".format(GFFORMID), gwizDebounce(function () {
var _GFCalc = rgars(window, 'gf_global/gfcalc/{0}'.format(GFFORMID));
$(document).on("gform_post_conditional_logic.gfCalc_{0}".gformFormat(GFFORMID), gwizDebounce(function () {
var _GFCalc = rgars(window, 'gf_global/gfcalc/{0}'.gformFormat(GFFORMID));
_GFCalc.runCalcs(formId, _GFCalc.formulaFields);
}, 15));
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ window.gform.addFilter('gppt_validation_result', function (result, gppt, formId)
var group = gplc.groups[i];
var fields = group.fields;
var fieldsVisible = true;
var groupValidationMessage = validationMessage.format(group.min);
var groupValidationMessage = validationMessage.gformFormat(group.min);

$(gplc.getSelector(group.fields)).each(function () {
var fieldVisible = $(this).is(':visible');
Expand Down
14 changes: 7 additions & 7 deletions gp-limit-checkboxes/gplcb-set-max-by-field-value.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Gravity Perks // GP Limit Checkboxes // Set Max Limit by Field Value
* https://gravitywiz.com/documentation/gravity-forms-limit-checkboxes/
*
*
* Set the max number of checkboxes that can be checked in a Checkbox field based
* on the value entered/selected in another field.
*
*
* Instructions:
*
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-custom-javascript/
* 2. Configure based on the inline instructions.
Expand All @@ -15,15 +15,15 @@ gform.addFilter( 'gplc_group', function( group, fieldId, $elem, gplc ) {

// Update "3" to the ID of your Checkbox field.
var checkboxFieldId = 3;

// Update "4" to the ID of your field whose value whould be used to set the max checkbox limit.
var maxFieldId = 4;

if ( group.fields.indexOf( checkboxFieldId ) === -1 ) {
return group;
}
var $maxField = $( '#input_{0}_{1}'.format( GFFORMID, maxFieldId ) );

var $maxField = $( '#input_{0}_{1}'.gformFormat( GFFORMID, maxFieldId ) );
var isRadio = $maxField.hasClass( 'gfield_radio' );

if ( isRadio ) {
Expand All @@ -42,7 +42,7 @@ gform.addFilter( 'gplc_group', function( group, fieldId, $elem, gplc ) {
if ( ! $maxField.data( 'gplcIsBound' ) ) {
// If our max field value changes, reset the checkboxes and reinitialize GPLC.
$maxField.on( 'change', function() {
$( '#field_{0}_{1}'.format( GFFORMID, checkboxFieldId ) ).find( 'input' ).prop( 'checked', false );
$( '#field_{0}_{1}'.gformFormat( GFFORMID, checkboxFieldId ) ).find( 'input' ).prop( 'checked', false );
gplc.handleCheckboxClick( $elem );
} );
$maxField.data( 'gplcIsBound', true );
Expand Down
6 changes: 3 additions & 3 deletions gp-limit-choices/gplc-field-groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public static function output_script() {
var groupsToRefresh = [];
for ( var i = 0, max = GPLCFieldGroupConditionalLogic.length; i < max; i ++ ) {
var group = GPLCFieldGroupConditionalLogic[i];
var formFieldId = "{0}_{1}".format( group.formId, group.targetFieldId );
var formFieldId = "{0}_{1}".gformFormat( group.formId, group.targetFieldId );

// Skip inapplicable and hidden target fields
if ( formId != group.formId || groupsToRefresh[formFieldId] || ! group.$targetField.is( ':visible' ) ) {
Expand Down Expand Up @@ -255,8 +255,8 @@ public static function output_script() {

self.init = function () {

self.$form = $( '#gform_wrapper_{0}'.format( self.formId ) );
self.$targetField = $( '#field_{0}_{1}'.format( self.formId, self.targetFieldId ) );
self.$form = $( '#gform_wrapper_{0}'.gformFormat( self.formId ) );
self.$targetField = $( '#field_{0}_{1}'.gformFormat( self.formId, self.targetFieldId ) );

gform.addAction( 'gform_input_change', function ( elem, formId, fieldId ) {
if ( $.inArray( parseInt( fieldId ), self.triggerFieldIds ) !== - 1 ) {
Expand Down
8 changes: 4 additions & 4 deletions gp-multi-page-navigation/gpmpn-page-permalinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ public function output_script() {

self.init = function() {

if ( typeof window[ 'GPMPNPagePermalinks_{0}'.format( self.formId ) ] !== 'undefined' ) {
if ( typeof window[ 'GPMPNPagePermalinks_{0}'.gformFormat( self.formId ) ] !== 'undefined' ) {
return;
}

window[ 'GPMPNPagePermalinks_{0}'.format( self.formId ) ] = self;
window[ 'GPMPNPagePermalinks_{0}'.gformFormat( self.formId ) ] = self;

self.history.push( { gpmpnPage: self.defaultPage } );

Expand All @@ -149,7 +149,7 @@ public function output_script() {
// $( '.gform_previous_button:visible' ).click();
// }
// Temporary solution: reload first page when user uses browser's back/next buttons.
window.location = window.location.origin + '/{0}/{1}/'.format( self.pagename, self.permalinks[1] );
window.location = window.location.origin + '/{0}/{1}/'.gformFormat( self.pagename, self.permalinks[1] );
} );

self.isInit = true;
Expand All @@ -163,7 +163,7 @@ public function output_script() {
var state = { gpmpnPage: self.currentPage };

self.history.push( state );
window.history.pushState( state, null, '/{0}/{1}/'.format( self.pagename, self.permalinks[ currentPage ] ) );
window.history.pushState( state, null, '/{0}/{1}/'.gformFormat( self.pagename, self.permalinks[ currentPage ] ) );

}

Expand Down
18 changes: 9 additions & 9 deletions gp-nested-forms/gpnf-copy-parent-value-manually.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* cannot differentiate between them and will populate incorrect values.
*/
gform.addAction( 'gpnf_init_nested_form', function( childFormId, gpnf ) {

// Update "123" to your the ID of your child form.
var targetChildFormId = 123;
var targetChildFormId = 123;

// Update "4" to the ID of the child field in which the parent form ID will be populated.
var childFieldId = 4;

// Update "5" to the ID of the parent field whose value will be copied to the child field.
var parentFieldId = 5;

Expand All @@ -24,12 +24,12 @@ gform.addAction( 'gpnf_init_nested_form', function( childFormId, gpnf ) {
} );

function copyParentFormValue( parentFormId, parentFieldId, childFormId, childFieldId ) {
var value = jQuery ( '#input_{0}_{1}'.format( parentFormId, parentFieldId ) ).val();
// Delaying setting value so Populate Anything can pick up the change event.

var value = jQuery ( '#input_{0}_{1}'.gformFormat( parentFormId, parentFieldId ) ).val();

// Delaying setting value so Populate Anything can pick up the change event.
setTimeout( function() {
$( '#input_' + childFormId + '_' + childFieldId ).val( value ).change();
} );

}
6 changes: 3 additions & 3 deletions gp-nested-forms/gpnf-hide-nested-entries-table-if-empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @var string $add_button The markup for the "Add Entry" button.
* @var string $add_button_message The markup for situational messages related to the "Add Entry" button.
*/
extract( $args );

Check warning on line 21 in gp-nested-forms/gpnf-hide-nested-entries-table-if-empty.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

extract() usage is highly discouraged, due to the complexity and unintended issues it might cause.
?>
<div class="gpnf-nested-entries-container ginput_container">

Expand All @@ -45,11 +45,11 @@
<?php endforeach; ?>
<td class="gpnf-row-actions" style="display: none;" data-bind="visible: true">
<ul>
<li class="edit"><button class="edit-button" data-bind="click: $parent.editEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['edit_entry'] ); ?>'.format( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['edit_entry']; ?></button></li>
<li class="edit"><button class="edit-button" data-bind="click: $parent.editEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['edit_entry'] ); ?>'.gformFormat( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['edit_entry']; ?></button></li>
<?php if ( $enable_duplication ) : ?>
<li class="duplicate" data-bind="visible: ! $parent.isMaxed()"><button href="#" data-bind="click: $parent.duplicateEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['duplicate_entry'] ); ?>'.format( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['duplicate_entry']; ?></button></li>
<li class="duplicate" data-bind="visible: ! $parent.isMaxed()"><button href="#" data-bind="click: $parent.duplicateEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['duplicate_entry'] ); ?>'.gformFormat( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['duplicate_entry']; ?></button></li>
<?php endif; ?>
<li class="delete"><button class="delete-button" data-bind="click: $parent.deleteEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['delete_entry'] ); ?>'.format( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['delete_entry']; ?></button></li>
<li class="delete"><button class="delete-button" data-bind="click: $parent.deleteEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['delete_entry'] ); ?>'.gformFormat( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['delete_entry']; ?></button></li>
</ul>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion gp-nested-forms/gpnf-limit-entry-min-max-from-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function output_script() {
gform.addAction( 'gform_input_change', function( el, formId, fieldId ) {
if ( el.id === maxFieldId ) {
// Force Knockout to recalculate the max when the number has changed
window[ 'GPNestedForms_{0}_{1}'.format( self.parentFormId, self.nestedFormFieldId ) ].viewModel.entries.valueHasMutated();
window[ 'GPNestedForms_{0}_{1}'.gformFormat( self.parentFormId, self.nestedFormFieldId ) ].viewModel.entries.valueHasMutated();
}
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* https://gravitywiz.com/documentation/gravity-forms-nested-forms/
*
* Instructions:
*
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-custom-javascript/
*/
gform.addAction( 'gpnf_post_duplicate_entry', function( entry, data, response ) {
$( 'tr[data-entryId="{0}"]'.format( entry.id ) ).find( '.edit a' ).click();
$( 'tr[data-entryId="{0}"]'.gformFormat( entry.id ) ).find( '.edit a' ).click();
} );
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
* @var string $add_button The markup for the "Add Entry" button.
* @var string $add_button_message The markup for situational messages related to the "Add Entry" button.
*/
extract( $args );

Check warning on line 23 in gp-nested-forms/gpnf-template-single-submission-child-form.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

extract() usage is highly discouraged, due to the complexity and unintended issues it might cause.
?>
<div class="gpnf-nested-entries-container ginput_container">

<div data-bind="visible: entries().length, foreach: entries">
✅ Child form submitted!
<button class="edit-button" data-bind="click: $parent.editEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['edit_entry'] ); ?>'.format( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['edit_entry']; ?></button>
<button class="delete-button" data-bind="click: $parent.deleteEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['delete_entry'] ); ?>'.format( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['delete_entry']; ?>
<button class="edit-button" data-bind="click: $parent.editEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['edit_entry'] ); ?>'.gformFormat( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['edit_entry']; ?></button>
<button class="delete-button" data-bind="click: $parent.deleteEntry, attr: { 'aria-label': '<?php echo esc_js( $aria_labels['delete_entry'] ); ?>'.gformFormat( $index() + 1, f<?php echo $nested_fields[0]['id']; ?>.label ) }"><?php echo $labels['delete_entry']; ?>
</div>

<div data-bind="visible: ! entries().length">
Expand Down
4 changes: 2 additions & 2 deletions gp-nested-forms/gpnf-triggered-population.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public function output_script() {

self.init = function() {

$form = $( '#gform_{0}'.format( self.formId ) );
$form = $( '#gform_{0}'.gformFormat( self.formId ) );

$( '#field_{0}_{1}'.format( self.formId, self.triggerFieldId ) ).find( 'input' ).on( 'change', function() {
$( '#field_{0}_{1}'.gformFormat( self.formId, self.triggerFieldId ) ).find( 'input' ).on( 'change', function() {
var input = $( this );
var value = input.val();
var checked = input[0].checked;
Expand Down
6 changes: 3 additions & 3 deletions gp-populate-anything/gppa-populate-child-entries.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function output_script() {

self.init = function() {

self.$peidField = $( '#input_{0}_{1}'.format( self.formId, self.fieldId ) );
self.$peidField = $( '#input_{0}_{1}'.gformFormat( self.formId, self.fieldId ) );

if ( typeof window[ 'gpnfSessionPromise_' + self.formId ] === 'undefined' ) {
gform.addAction( 'gpnf_session_initialized', function() {
Expand All @@ -131,7 +131,7 @@ public function output_script() {

self.setupPeidField = function() {

var gpnfCookie = $.parseJSON( self.getCookie( 'gpnf_form_session_{0}'.format( self.formId ) ) );
var gpnfCookie = $.parseJSON( self.getCookie( 'gpnf_form_session_{0}'.gformFormat( self.formId ) ) );

if ( ! self.$peidField.val() ) {
self.$peidField
Expand All @@ -140,7 +140,7 @@ public function output_script() {
}

for ( var i = 0; i < self.nestedFormFieldIds.length; i++ ) {
window[ 'GPNestedForms_{0}_{1}'.format( self.formId, self.nestedFormFieldIds[ i ] ) ].viewModel.entries.subscribe( function( entries ) {
window[ 'GPNestedForms_{0}_{1}'.gformFormat( self.formId, self.nestedFormFieldIds[ i ] ) ].viewModel.entries.subscribe( function( entries ) {
self.$peidField.data( 'lastValue', '' ).change();
} );
}
Expand Down
12 changes: 6 additions & 6 deletions gp-populate-anything/gppa-wait-for-population-on-enter-press.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* Gravity Perks // Populate Anything // Wait for Population Before Submitting When Enter Key Pressed
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* By default, the form is immediately submitted after the Enter key is pressed. This means if the field triggers
*
* By default, the form is immediately submitted after the Enter key is pressed. This means if the field triggers
* dynamic population of other fields via Populate Anything, that population will not occur before the form is submitted.
*
* This snippet allows to to specify trigger fields that should wait for Populate Anything to finish populating before
* allowing the Enter-keypress-triggered submission from continuing.
*
*
* Instructions:
*
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-custom-javascript/
*
*
* 2. Add "gppa-wait-for-pop" to the CSS Class Name setting for field that will trigger the population.
*/
$( document ).on( 'keypress', '.gppa-wait-for-pop', function( e ) {
Expand All @@ -25,7 +25,7 @@ $( document ).on( 'keypress', '.gppa-wait-for-pop', function( e ) {
.off( 'gppa_updated_batch_fields.gpqr' )
.on( 'gppa_updated_batch_fields.gpqr', function( event, formId ) {
setTimeout( function() {
$( '#gform_{0}'.format( formId ) ).submit();
$( '#gform_{0}'.gformFormat( formId ) ).submit();
} );
} );
return false;
Expand Down
4 changes: 2 additions & 2 deletions gp-preview-submission/gpps-live-refresh.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public function output_script() {

self.init = function() {

self.$form = $( '#gform_wrapper_{0}'.format( self.formId ) );
self.$targetField = $( '#field_{0}_{1}'.format( self.formId, self.targetFieldId ) );
self.$form = $( '#gform_wrapper_{0}'.gformFormat( self.formId ) );
self.$targetField = $( '#field_{0}_{1}'.gformFormat( self.formId, self.targetFieldId ) );

self.$form.find( 'input, select, textarea' ).on( 'change', function() {
self.refresh();
Expand Down
4 changes: 2 additions & 2 deletions gp-qr-code/gpqr-auto-submit-on-scan-with-gppa.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
*/
gform.addAction( 'gpqr_on_scan_success', function( decodedText, decodedResult, gpqrObj ) {
$( document ).off( 'gppa_updated_batch_fields.gpqr' );
$( document ).on( 'gppa_updated_batch_fields.gpqr', function( event, formId ) {
$( document ).on( 'gppa_updated_batch_fields.gpqr', function( event, formId ) {
if ( gpqrObj.formId == formId ) {
setTimeout( function() {
$( '#gform_{0}'.format( formId ) ).submit();
$( '#gform_{0}'.gformFormat( formId ) ).submit();
} );
}
} );
Expand Down
2 changes: 1 addition & 1 deletion gravity-forms/gw-check-all-checkboxes-by-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
// Update "4" and "5" to Checkbox field IDs which should be selected by default.
$.each( [ 4, 5 ], function( index, fieldId ) {
$checkboxes = $( '#field_GFFORMID_{0}'.format( fieldId ) ).find( 'input' );
$checkboxes = $( '#field_GFFORMID_{0}'.gformFormat( fieldId ) ).find( 'input' );
if ( $checkboxes.filter( ':checked' ).length === 0 ) {
$checkboxes.prop( 'checked', true );
}
Expand Down
Loading
Loading