FormIt.FormItStateOptions

Skip to end of metadata
Go to start of metadata


What is FormItStateOptions?

FormItStateOptions is an assistance snippet for FormIt 1.7.0+ that will output an option list of U.S. states. It is useful for forms that need a dropdown list of U.S. states.

Usage

Simply add the Snippet to your form, in a <select> call:

<select name="state">
[[!FormItStateOptions? &selected=`[[!+fi.state]]`]]
</select>

Note how we are passing the value of the "fi.state" placeholder (which stores the value of the state field) into the selected parameter. This tells FormItStateOptions to select the last-selected option in the form.

FormItStateOptions Properties

FormItStateOptions comes with some default properties you can override. They are:

Name Description Default
selected The country value to select.  
selectedAttribute Optional. The HTML attribute to add to a selected country. selected="selected"
tpl Optional. The chunk to use for each country dropdown option.  
useAbbr If 1, will use the state abbreviation for the value. If 0, will use the full state name. 1
toPlaceholder Optional. Use this to set the output to a placeholder instead of outputting directly.  

See Also

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.