wire:confirm
In CBWIRE, wire:confirm prompts users for confirmation before executing potentially irreversible actions, such as deletions or updates. This feature enhances the security and user-friendliness of your application by ensuring that actions are intended.
Example: Confirming Subscription Cancellation
Here’s an example of how to implement wire:confirm for a "Cancel Subscription" button:
In your cancelSubscription view file (wires/cancelSubscription.cfm):
In this setup, when the user clicks "Cancel Subscription," CBWIRE triggers a confirmation dialog. If the user confirms the action by pressing "OK," the subscription cancellation process will proceed. If they cancel, no action will be taken.
Prompting Users for Specific Input
CBWIRE supports prompting the user to enter a specific string for actions requiring an extra layer of confirmation.
Suppose you want the user to confirm their intention to deactivate their account by typing a specific phrase:
In your deactivateAccount view file (wires/deactivateAccount.cfm):
With this configuration, when users press "Deactivate Account," they will be prompted to type "DEACTIVATE" into the input field. The action will only be executed if the input matches exactly, adding security to sensitive operations.
Last updated