Question

I have a select statement an im trying to get the drop down select menu to display a prompt line like Please Select instead of just a default selection.

<g:select name="country" from="${countrylist}" />

Is there a way to do this with the value attribute or something like that?

Was it helpful?

Solution

Use the noSelection attribute of the g:select tag. Documentation.

<g:select name="country" from="${countrylist}" noSelection="['':'Please select a country']" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top