Grails forms tag identifier property for css

When you use the grails form tag, how can you have the id selector in the display tag of the HTML form?

If you use

<g:form action="register" controller="registration" id="registrationform"/> 

it displays the form url as /registration/register/registrationform .

Is there a way to provide a property that displays?

+4
source share
1 answer

The easiest way -

 <g:form action="register" controller="registration" name="registrationForm" /> 

The name attribute will be used to render the id attribute

You can also use the URL parameter and pass the map for your action and controller.

 <g:form url="[action:'register', controller:'registration']" id="registrationForm" /> 
+10
source

Source: https://habr.com/ru/post/1345279/


All Articles