We have a signup form for existing customers and have all text input fields populating with their information (first name, last name and email address). We also have a list of radio button group with three radio buttons and need to pre-populate (select) the radio button that corresponds with their contact record in our database.
I've mapped their contact record info to a var for this field.
var flavorFave = <span class=dbrecord >Favorite Ice Cream Flavor</span>
Here's the form code for the radio buttons:
<input type="radio" class="custom-control-input" id="Vanilla" name="flavor" value="Vanilla">
<input type="radio" class="custom-control-input" id="Chocolate" name="flavor" value="Chocolate">
<input type="radio" class="custom-control-input" id="Strawberry" name="flavor" value="Strawberry">
...
...
...
How can we configure the form so that the correct radio button is checked if the variable "flavorFave" is defined? For example, if the variable "flavorFave" equals "Vanilla", then we want the "Vanilla" radio button to be checked.