I am using a g:select tag like this:
<td><g:select name="newCity" id="${'newCity_' +cityData.uid}" from="${cityData.name}" value="${cityData.someValue}" noSelection="${['null':'Select City...']}" class="newCity" /> </td> which renders the following HTML:
<td> <select name="newCity" id="newCity_abc" class="newCity" > <option value="null">Select City...</option> <option value="A" >A</option> <option value="B" >B</option> <option value="C" >C-</option> <option value="D" >D</option> </select> </td> However, I want my HTML to look like this; with class inserted since I am doing some javascript validation:
<td> <select name="newCity" id="newCity_abc" class="newCity" > <option value="null">Select City...</option> <option value="A" class="populated" >A</option> <option value="B" class="notpopulated" >B</option> <option value="C" class="populated" >C</option> <option value="D" class="notpopulated" >D</option> </select> </td> Is this possible?
Do I need to create a custom tag library to acheive this?
Any help will be appreciated, Thanks!