Pre-selecting radio button based on database
I'm trying to find the code to pre-select a radio button based on the contact record. For example, we have a list of Major League Baseball playoff contenders and want to display a radio button list of National League playoff contenders:
Los Angeles Dodgers
St. Louis Cardinals
Atlanta Braves
I've mapped a variable to the database, called natLeagueFave. How can I set it up so that it selects the radio button?
- var natLeagueFave = <span class=dbrecord >Favorite Team</span>
Form
- <input type="radio" class="custom-control-input" id="Dodgers" name="natLeagueFave " value="Dodgers">
- <input type="radio" class="custom-control-input" id="Cardinals" name="natLeagueFave " value="Cardinals">
- <input type="radio" class="custom-control-input" id="Braves" name="natLeagueFave " value="Braves">