Recheck Conditional Logic

Hi Everyone,

Right now I have a form that will show different messages depending on the city the user is in.
If the population of the city is 40,000 or more it shows a big green success message via custom HTML, otherwise it shows a big yellow warning.

I am running javascript to pull a json file of populations once the user enters their city. The javascript sets the value of the hidden population field shortly after the user enters their city.

My issue is that HTML message block that uses condition logic only updates when I click on the population field, which is typically hidden. Is there any way I can force this HTML block to re evaluate its conditional logic?

Hi Jonathan. You can use the gform_post_render hook to rerun the scripts, including the conditional logic scripts, after populating that field.

jQuery(document).trigger('gform_post_render', [14, 1]);

Replace 14 with the form ID and 1 with the form page number after you’ve populated your data via your custom JavaScript. That should trigger the conditional logic evaluation manually. Let us know if that works out for you. Thank you.