diff --git a/gp-populate-anything/gppa-select-first-random-choice-on-radio.js b/gp-populate-anything/gppa-select-first-random-choice-on-radio.js index c32c556db..61e31bf2a 100644 --- a/gp-populate-anything/gppa-select-first-random-choice-on-radio.js +++ b/gp-populate-anything/gppa-select-first-random-choice-on-radio.js @@ -6,5 +6,8 @@ * https://gravitywiz.com/gravity-forms-custom-javascript/ */ -// Update "4" to the the ID of your Radio Button field. -$( 'input[id^=choice_' + GFFORMID + '_4_' )[0].checked = true; +// click vs checked: Click triggers other GPPA Fields to be populated appropriately as well, whereas checked does not trigger further reloads. +// Update "3" to the the ID of your Radio Button field, and keep it as "0" for for the first choice. +// Rename "SelectDefaultRoomType" to something unique. +const SelectDefaultRoomType = document.getElementById('choice_' + GFFORMID + '_3_0'); SelectDefaultRoomType.click(); +