randomizertech
randomizertech

Reputation: 2329

Groovy/Grails: How do I make my datePicker blank or null by default instead of showing today's date?

That is basically my question. It is showing me today's date and not a blank or null or '' date, even if I put null or '' it runs perfectly but keeps showing me today's date, not a blank dropdown box. So I want to change the default to being blank when the gsp loads, not with today's date.

Thanks

Upvotes: 15

Views: 4759

Answers (1)

stefanglase
stefanglase

Reputation: 10402

The usage of the attribute default is not documented in the Grails documentation but its functionality can be extracted from the implementation. Use the attribute default="none"to stop the datePicker from using the current date and provide an empty text as the noSelection value:

<g:datePicker default="none" noSelection="['':'']" />

More information about the attribute noSelection can be found in the Grails documentation.

Upvotes: 28

Related Questions