actionSubmit
Purpose
Creates a submit button with the indicated value. Javascript event handlers can be added using the same parameter names as in HTML.
Examples
<g:actionSubmit value="Update" />
<g:actionSubmit value="${message(code:'label.update')}" action="Update" />
<g:actionSubmit value="Delete" />
<g:actionSubmit value="DeleteAll" onclick="return confirm('Are you sure???')" />
Description
Attributes
value
(required) - The title of the button and name of action when not explicitly defined.
action
(optional) - The name of the action to be executed, otherwise it is derived from the value.
Source
Show Source
def actionSubmit = {attrs ->
attrs.tagName = "actionSubmit"
if (!attrs.value) {
throwTagError("Tag [$attrs.tagName] is missing required attribute [value]")
} // add action and value
def value = attrs.remove('value')
def action = attrs.action ? attrs.remove('action') : value out << "<input type=\"submit\" name=\"_action_${action}\" value=\"${value}\" " // process remaining attributes
outputAttributes(attrs) // close tag
out << '/>' }