I a musing a front-end form to create an entry in the CP. In my form I am using a SuperTable that contains two fields/blocks.
- Size - [text input]
- Measurement - [dropdown]
Here is what my template looks like:
<div class="row">
<input type="hidden" name="fields[lotSize]">
<input type="hidden" name="fields[lotSize][new1][type]" value="1">
<div class="col-xs-6">
<div class="form-group">
<label for="lotSize">Lot Size</label>
<input type="text" class="form-control" name="fields[lotSize][new1][fields][size]">
</div>
</div>
<div class="col-xs-6">
<label for="measurement">Measurement</label>
<select name="fields[lotSize][new1][fields][measurement]">
{# Loop through the values instead of hard-coding #}
<option value="">Select</option>
<option value="squareFeet">Square Feet</option>
<option value="acres">Acres</option>
</select>
</div>
</div>
I've been reading through Updating a Super Table field from a front end form and have tried this:
{% set fieldHandle = 'lotSize' %}
{% set field = craft.fields.getFieldByHandle(fieldHandle) %}
{% set blocktype = craft.superTable.getSuperTableBlocks(field.id)[0] %}
...But I'm not sure where to go next to get to the measurement
field.
I have attached a screenshot of my CP page to help show what I am trying to accomplish. Thank you for any suggestions!