Skip to content

Miscellaneous

buttonTo()

buttonTo() — returns any

Creates a form containing a single button that submits to the URL. The URL is built the same way as the linkTo function.

NameTypeRequiredDefaultDescription
textstringyes—The text content of the button.
confirmstringyes—See documentation for linkTo.
imagestringyes—If you want to use an image for the button pass in the link to it here (relative from the images folder).
disableanyyes—Pass in true if you want the button to be disabled when clicked (can help prevent multiple clicks), or pass in a string if you want the button disabled and the text on the button updated (to “please wait…”, for example).
routestringyes—See documentation for URLFor.
controllerstringyes—See documentation for URLFor.
actionstringyes—See documentation for URLFor.
keyanyyes—See documentation for URLFor.
paramsstringyes—See documentation for URLFor.
anchorstringyes—See documentation for URLFor.
onlyPathbooleanyestrueSee documentation for URLFor.
hoststringyes—See documentation for URLFor.
protocolstringyes—See documentation for URLFor.
portnumericyes0See documentation for URLFor.
#buttonTo(text="Delete Account", action="perFormDelete", disable="Wait...")#

// apply attributes to the input element by prefixing any arguments with "input"
#buttonTo(text="Edit", action="edit", inputId="edit-button", inputClass="edit-button-class")#