Automatically Submit After Successful Scan

When using the QR scanner, automatically submit the form after a successful scan.

We recommend installing this snippet with our free Custom Javascript plugin:

Code

Filename: gpqr-auto-submit-on-scan.js

/**
 * Gravity Perks // GP QR Code // Automatically Submit After Successful Scan
 * https://gravitywiz.com/documentation/gravity-forms-qr-code/
 *
 * When using the QR scanner, automatically submit the form after a successful scan.
 *
 * We recommend installing this snippet with our free Custom Javascript plugin:
 * https://gravitywiz.com/gravity-forms-code-chest/
 */
gform.addAction( 'gpqr_on_scan_success', function( decodedText, decodedResult, gpqr ) {
	gpqr.$input.parents( 'form' ).submit();
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.