cfmessagebox

Creates MessageBox

  <cfmessagebox type="alert" message="" name="">

 cfmessagebox(type="alert", message="", name="");

This tag requires Adobe ColdFusion 9 and up.  Not supported on Lucee, etc.

Attribute Reference

labelcancel string

The text to put on the cancel button of a prompt message box.

callbackHandler string

callback function which will be called when any ok|no|cancel button is clicked

labelok string

The text to put on an alert button and prompt message box OK button.

title string

The title for the message box.

type string
Required

Type of action to be performed
Values:
  • alert
  • confirm
  • prompt

message string
Required

Message text which will be displayed

labelno string

The text to put on the button used for a negative response in a confirm message box.

labelyes string

The text to put on the button used for a positive response in a confirm message box.

multiline boolean
Default: false

Applies for prompt action only. Signify whether prompt is textarea(multiliner) or oneliner(textField)Default=false
Values:
  • true
  • false

name string
Required

Name of the messageBox

bodyStyle string

A CSS style specification for the body of the message box. As a general rule, use this attribute to set color and font styles

buttonType string

Applies to the control type - confirm
The buttons to display on the message box
Values:
  • yesno
  • yesnocancel

icon string

Specifies the following CSS classes
error: Provides the error icon. You can use this icon when displaying error messages.
info: Provides the info icon. You can use this icon when displaying any information.
question: Provides the question icon. You can use this icon in a confirmation message box that prompts a user response.
warning: Provides the warning icon. You can use this icon when displaying a warning message

width numeric

Width of the message box in pixels.

x numeric

The X (horizontal) coordinate of the upper-left corner of the message box .
ColdFusion ignores this attribute if you do not set the y attribute.

y numeric

The Y (vertical) coordinate of the upper-left corner of the message box.
ColdFusion ignores this attribute if you do not set the x attribute.

Examples
Sample code using the cfmessagebox tag

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub