Grails form tag ID property for css
When开发者_JAVA百科 you use grails form tag how can you have an id selector in the rendered HTML form tag?
If you use
<g:form action="register" controller="registration" id="registrationform"/>
it renders the form post URL as the /registration/register/registrationform
.
Is there a way to provide a property that renders ?
Easiest way is
<g:form action="register" controller="registration" name="registrationForm" />
The name attribute will be used to render the id attribute
You could also use the URL parameter and pass in a map for your action and controller.
<g:form url="[action:'register', controller:'registration']" id="registrationForm" />
精彩评论