countrySelect

Purpose

Helper tag for creating HTML select boxes containing Country names.

Examples

// create a select for all countries
<g:countrySelect name="user.country" value="${country}"
          noSelection="['':'-Choose your age-']"/>

// create select from a list of ISO3166_3 country codes <g:countrySelect name="user.country" from="['gbr', 'usa', 'deu']" value="${user?.country}"/>

// create country select with internationalized labels // expected properties in messages.properties: // countryname.gbr=My United Kingdom // countryname.usa=Home of the brave // countryname.deu=Germany <g:countrySelect name="user.country" from="['gbr', 'usa', 'deu'] valueMessagePrefix="countryname" />

Description

This class renders a select box with one option for every ISO3166_3 country code, or for the list of country codes supplied in "from".

The 3-letter ISO codes are used in lowercase format.

Attributes

Source

Show Source