Skip to content

Commit

Permalink
Fix Ninja Forms Ajax processing.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Jul 20, 2024
1 parent 07d40e9 commit ba1103e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/js/hcaptcha-nf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Ninja Forms controller file.
*/

/* global hcaptcha, Marionette, Backbone */
/* global hcaptcha, Marionette, nfRadio */

wp.hooks.addFilter(
'hcaptcha.ajaxSubmitButton',
Expand All @@ -20,12 +20,12 @@ document.addEventListener( 'DOMContentLoaded', function() {
const HCaptchaFieldController = Marionette.Object.extend( {
initialize() {
// On the Form Submission's field validation.
const submitChannel = Backbone.Radio.channel( 'submit' );
const submitChannel = nfRadio.channel( 'submit' );
this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha );
this.listenTo( submitChannel, 'validate:field', this.updateHcaptcha );

// On the Field's model value change.
const fieldsChannel = Backbone.Radio.channel( 'fields' );
const fieldsChannel = nfRadio.channel( 'fields' );
this.listenTo( fieldsChannel, 'change:modelValue', this.updateHcaptcha );
},

Expand All @@ -38,7 +38,7 @@ document.addEventListener( 'DOMContentLoaded', function() {
// Check if the Model has a value.
if ( model.get( 'value' ) ) {
// Remove Error from Model.
Backbone.Radio.channel( 'fields' ).request(
nfRadio.channel( 'fields' ).request(
'remove:error',
model.get( 'id' ),
'required-error'
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ Instructions for popular native integrations are below:

= 4.4.0 =
* Fixed conflict with Ninja Forms Upload field.
* Fixed Ninja Forms Ajax processing.

= 4.3.1 =
* Added a live form in the Contact Form 7 admin form view.
Expand Down

0 comments on commit ba1103e

Please sign in to comment.