Link to home
Start Free TrialLog in
Avatar of Bill
BillFlag for United States of America

asked on

How to display Coldfusion alert message box icons

I want to display various alert messages and have different icons displayed based on the type of error message. i.e.:
Question
Information
Warning
Criticial

Can some provide me with the correct way to display these icons?

Thank you for your assistance
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bill

ASKER

Thank you for your response.

Does this solution work on versions 8 & 9

Thank you
No. cfmessagebox was introduced in CF9.  For CF8, you'd have to create your own using cfwindow or cfdiv.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
btw- if you want to make the header taller (the default size is 25px and that might make your icon too small)

you need to add a few more style defs
<style>
.x-dlg-dlg-body{
top:45px!important; /*this sets the position of the window body in relation to the header. It should be the same # px ans the height set in the header classes*/
}

.infHdr { background: url(/CFIDE/scripts/ajax/resources/ext/images/default/layout/Icon.gif) no-repeat  ;
color:black;
font:normal 11px tahoma, verdana, helvetica;
text-align: center;
font-weight:bold;
height:45px!important; /*the height of the header. should be the same as the gif height*/
display:block;
}

.critHdr { background: url(/CFIDE/scripts/ajax/resources/ext/images/default/layout/Icon.gif) no-repeat  ;
color:red;
font:normal 11px tahoma, verdana, helvetica;
text-align: center;
font-weight:bold;
height:45px!important; /*the height of the header. should be the same as the gif height*/
display:block;
}
</style>
I don't think this question should be deleted.  These two responses answer the question of how to create a message box with a custom icon in CF8 and CF9:

* How to create a message box in CF9
* How to create a message box in CF8