I'm struggling arround with the g:radioGroup
tag -- I want to create some radios and some labels correspondig to the radios:
<g:radioGroup name="stateOfHealth" value="${review.stateOfHealth}" id="stammp"
labels="['1','2','3','4','5']"
values="['bad','suboptimal','well','veryWell','excellent']">
<span class="radioSpan"> ${it.radio}</span>
<label for="${ ???? }">${it.label}</label>
</g:radioGroup>
What do I need to do to insert in the label's "for" attribute to match the right radio?
You don't need to set the for attribute, just wrap the radio with the label, like this:
<g:radioGroup name="stateOfHealth" value="${review.stateOfHealth}" id="stammp"
labels="['1','2','3','4','5']"
values="['bad','suboptimal','well','veryWell','excellent']">
<label>
<span class="radioSpan">${it.radio}</span>
${it.label}
</label>
</g:radioGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With