简体   繁体   中英

grails gsp radiogroup, how to set id for each input radio field

How to set id for each input attribute in gsp grails app.

<g:radioGroup id="x">
   ${it.label} ${it.radio}
</g:radioGroup>

id="x" is not working

The property id is not supported in the tag radioGroup .

A solution would be to generate yourself the radio group with ids like this:

<g:each in="${entities}">
    <p>${it.name}: <input id="X" type="radio" name="entityName" value="${it.value}"/></p>
</g:each>

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