buttonTo()
Description
Creates a form containing a single button that submits to the URL. The URL is built the same way as the linkTo() function.
Function Syntax
buttonTo([ text, confirm, image, disable, route, controller, action, key, params, anchor, onlyPath, host, protocol, port ])
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
text |
string |
No | |
The text content of the button. |
confirm |
string |
No | |
Pass a message here to cause a JavaScript confirmation dialog box to pop up containing the message. |
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 | |
Name of a route that you have configured in config/routes.cfm. |
controller |
string |
No | |
Name of the controller to include in the URL. |
action |
string |
No | |
Name of the action to include in the URL. |
key |
any |
No | |
Key(s) to include in the URL. |
params |
string |
No | |
Any additional params to be set in the query string. |
anchor |
string |
No | |
Sets an anchor name to be appended to the path. |
onlyPath |
boolean |
No | true |
If true, returns only the relative URL (no protocol, host name or port). |
host |
string |
No | |
Set this to override the current host. |
protocol |
string |
No | |
Set this to override the current protocol. |
port |
numeric |
No | 0 |
Set this to override the current port number. |
Examples
#buttonTo(text="Delete Account", action="perFormDelete", disabled="Wait...")#
