Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ public function maybe_output_script( $form ) {
}

if ( ! self::$script_output ) {
$this->script();
add_action( 'wp_footer', array( $this, 'output_script' ) );
add_action( 'gform_preview_footer', array( $this, 'output_script' ) );
Comment on lines +35 to +36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this to prevent AJAX errors?

Could we use gform_print_scripts instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and I will check gform_print_scripts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesnt work with gform_print_scripts, i think its because it not firing at the correct time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me considering this is a snippet. Thanks for checking!

self::$script_output = true;
}

return $form;
}

public function script() {
public function output_script() {
?>

<script type="text/javascript">
Expand Down Expand Up @@ -83,6 +84,15 @@ public function script() {
self.runCheck();
});

// Check when fields are repopulated because of GPPA
$(document).on( 'gppa_updated_batch_fields', function() {
self.runCheck();
});
// GPPA logic may enable submit button, disable that logic.
gform.addFilter( 'gppa_disable_form_navigation_toggling', function() {
return true;
});

self.runCheck();

}
Expand Down
Loading