fm:Form_State
This component allows you to generate a selectbox, with a list of states or provinces. You can specify a country-code (or multiple) to only show them for specific countries. Currently only provinces for the US and Canada are supported.
Example
<fm:Form_State countries="CA,US" name="state" />
Supported attributes
| Name | Required | Default | Description |
|---|---|---|---|
| class | Optional | The css classname that will be assigned to the actual html form field. Note that a few default classes might be added | |
| countries | Optional | CA | Specify the countrycodes for the states/provinces you'd like to see. Currently only CA and US are supported, you can specify multiple countries with commas. |
| defaultLabel | Optional | - please select - | The top value in the list. |
| disabled | Optional | N/A | This will set the html disabled attribute |
| id | Optional | randomized | The id of the form element. Note that this id will also be used for the 'for' attribute in the <label> component |
| label | Optional | N/A | This attribute will be used to generate labels for this component, if it's used within an fm:Form component |
| language | Optional | N/A | This specifies which language to use for the display of the form_country dropdown. Choices are:
|
| multiple | Optional | N/A | Setting multiple will allow the user to select multiple items in this dropdown. |
| name | Required | N/A | The name of the form field. This is how the value will be submitted back to the server |
| notapplicable | Optional | 0 | If this is set to '1', we will show a 'Not Applicable' option in the bottom of the list. The state-value for this will be 'XX' |
| readonly | Optional | N/A | This sets the html readonly attribute and controls if the user can change the value |
| required | Optional | 0 | Set required to '1' if you'd like the form validator to check if this form element has a value before submitting |
| size | Optional | N/A | The size attribute will be directly passed through to this component and dictates how much items are showing by default. |
| style | Optional | The style attribute for the actual form component | |
| title | Optional | N/A | Sets the title attribute on the select element. |
| value | Optional | The current value of the form element |
See also
More examples
<fm:Form_State countries="US" name="state" notapplicable="1" label="State (US-only)" defaultLabel="None selected" />
