View Helpers
submitTag()
Signature
Section titled “Signature”submitTag() — returns string
Available in: controller
Category: General Form Functions
Description
Section titled “Description”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.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
value | string | no | Save changes | Message to display in the button form control. |
image | string | no | — | File name of the image file to use in the button form control. |
prepend | string | no | — | String to prepend to the form control. Useful to wrap the form control with HTML tags. |
append | string | no | — | String to append to the form control. Useful to wrap the form control with HTML tags. |
encode | any | no | true | Use 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. |
Examples
Section titled “Examples”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>")#