Home How to limit a multiple selection of a <g:select>
Reply: 0

How to limit a multiple selection of a <g:select>

user845
1#
user845 Published in July 22, 2018, 8:01 pm

I want to limit a multiple selection to 1, because I want this format of list. I want to see all list always and don't want a dropdown list, and If I quit multiple="multiple" apears a dropdown list.

So, this is the code:

gsp:

<div class="field ${hasErrors(bean: cmd, field: 'subtypes', 'error')}">
    <label for="subtypes">
        <g:message code="requestSRO.requestSubtype.label"/>
    </label>
    <g:select name="subtypes" from="${requestSubtypes}" optionKey="code" multiple="multiple" optionValue="description" value="${cmd?.subtypes}" style="width: 100%;height: 100px" disabled="${!requestSubtypes ? true: false}"/>
</div>

I think <g:select> doesn't have a property to set the max limit of selections.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308803 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO