When 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" />
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