Skip to content

View Helpers

submitTag()

submitTag() — returns string

Available in: controller Category: General Form Functions

Builds and returns a string containing a submit button form control. Note: Pass any additional arguments like class, rel, and id, and the generated tag will also include those values as HTML attributes.

NameTypeRequiredDefaultDescription
valuestringnoSave changesMessage to display in the button form control.
imagestringnoFile name of the image file to use in the button form control.
prependstringnoString to prepend to the form control. Useful to wrap the form control with HTML tags.
appendstringnoString to append to the form control. Useful to wrap the form control with HTML tags.
encodeanynotrueUse this argument to decide whether the output of the function should be encoded in order to prevent Cross Site Scripting (XSS) attacks. Set it to true to encode all relevant output for the specific HTML element in question (e.g. tag content, attribute values, and URLs). For HTML elements that have both tag content and attribute values you can set this argument to attributes to only encode attribute values and not tag content.
1. Default submit button
#startFormTag(action="save")##submitTag()##endFormTag()#
2. Custom button label
#submitTag(value="Register Now")#
3. Submit button with CSS class and ID
#submitTag(value="Update Profile", class="btn btn-primary", id="updateBtn")#
4. Submit as an image button
#submitTag(image="submit-icon.png", value="Submit Form")#
5. Wrapping with prepend and append
#submitTag(value="Send Message", prepend="<div class='form-actions'>", append="</div>")#