Skip to content

Instantly share code, notes, and snippets.

@airways
Created April 25, 2012 00:40
Show Gist options
  • Save airways/2484930 to your computer and use it in GitHub Desktop.
Save airways/2484930 to your computer and use it in GitHub Desktop.
ProForm state selection
This is an example for how to display the label selected for a dropdown value
in the notification template. It is a bit verbose in the template code,
so I am planning to add a new option soon which will make extracting the
selected label as easy as getting the selected value.
Screenshots showing how to setup the form and the field to send an email to
the address set as the value for the same dropdown field:
Field settings for a field named "state":
* https://skitch.com/blueapples/8iwir/state-notification-field
Form settings for the Notification Field:
* https://skitch.com/blueapples/8iwig/state-notification-form-settings
Contents of the "default" template, where we handle the "state" field specially:
--------------------------------------------------------------------------------
Someone submitted the {form_name} form.<br/>
Submitted at {current_time format="%Y-%m-%d %H:%i:%s"}.<br/>
Values entered:
<table>
{fields}
{if field_name == "state"}
{field_setting_list}
{if selected}
<td>{field_label}</td><td>{label}</td>
{/if}
{/field_setting_list}
{if:else}
<tr><td>{field_label}:</td><td>{field_value}</td></tr>
{/if}
{/fields}
</table>
--------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment