Default the First Populated Choice for Radio having choices populated with GPPA

  1. Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/

Code

Filename: gppa-select-first-random-choice-on-radio.js

/**
 * Gravity Perks // Populate Anything // Default the First Populated Choice for Radio having choices populated with GPPA
 * https://gravitywiz.com/documentation/gravity-forms-populate-anything/
 *
 * 1. Install this snippet with our free Custom JavaScript plugin.
 *    https://gravitywiz.com/gravity-forms-code-chest/
 */

// Update "4" to the the ID of your Radio Button field.
$( 'input[id^=choice_' + GFFORMID + '_4_' )[0].checked = true;

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.