I have a contact form where I can choose the current state (U.S states). I have the field created in Sprout forms as "state" and is populated with all 50 states.
I would like to use "custom" html and loop through the values of that field. I just can't figure out how to get to it.
I know I can output the whole field/element using:
{{ craft.sproutForms.displayField('contact.state') }}
But that outputs a whole html element. I only want the options so I can loop over them like this:
....
<select>
<option value="">Select</option>
{% set states = form.getField('contact.state') %}
{% for option in states %}
<option value="{{ option.value }}">{{ option.label }}</option>
{% endfor %}
....
</select>