Return to v1.4.5 docs

buttonTo()



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

Name Type Required Default Description
text string No The text content of the button.
confirm string No See documentation for linkTo.
image string No If you want to use an image for the button pass in the link to it here (relative from the images folder).
disable any No 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).
route string No See documentation for URLFor.
controller string No See documentation for URLFor.
action string No See documentation for URLFor.
key any No See documentation for URLFor.
params string No See documentation for URLFor.
anchor string No See documentation for URLFor.
onlyPath boolean No true See documentation for URLFor.
host string No See documentation for URLFor.
protocol string No See documentation for URLFor.
port numeric No 0 See 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")#