开发者

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜