简体   繁体   中英

how to display values in select tag as 10,15,20,25 using grails select tag

how to display in select tag options values as 10,15,20,25 using grails select tag

<g:select  name="maxpage" from="${10..30}" />

10

15

20

25 . . . 1000

i wanted to display in this format

Simply use an array for the from attribute :

<g:select  name="maxpage" from="${[10,15,20,25]}" />

Update:

Assuming you would like to give a selection between 10 and 1000 with steps of 5 you could try this:

<g:select  name="maxpage" from="${(10..1000).step(5)}" /> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM