Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails form tag ID property for css

Tags:

grails

gsp

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 ?

like image 637
Jon Avatar asked Mar 25 '11 20:03

Jon


1 Answers

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" />
like image 162
Gregg Avatar answered Sep 19 '22 00:09

Gregg