Surprise, Pay Per Character! (JS)

This snippet requires the PHP counterpart gpppw-pay-per-character.php

Code

Filename: gpppw-pay-per-character.js

/**
 * Gravity Perks // Pay Per Word // Surprise, Pay Per Character! (JS)
 * https://gravitywiz.com/documentation/gravity-forms-pay-per-word/
 *
 * This snippet requires the PHP counterpart gpppw-pay-per-character.php
 */
gform.addFilter( 'gpppw_word_count', function( wordCount, text, gwppw, ppwField, formId ) {
	// Pay per character instead of words.
	return [...text].length;
} );

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.