Coldfusion bug – dialog box redirects on ok

I had an interesting problem to figure out today. On one of my forms I had a Help icon which the user could click and it would display a dialog box with help. Sometimes the box would just close, other times it would revert to the Directory INDEX.CFM page. It took a bit of sleuthing but I discovered I had used two different syntaxes for the HELP button. If the A HREF attribute was missing the # sign the page reverted to the Index.cfm page. If the HREF attibute contained the # sign it merely closed the dialog box. Had the CFOUTPUT been on the outside of the A tag I might have need to use HREF=”##”.

A HREF with the pound sign
<div class="helpbox"><a href="#" onclick="get_help('<cfoutput>#help_item_name#</cfoutput>');"><img src="images/help_icon.jpg" /></a></div>
vs
A HREF without the pound sign
<div class="helpbox"><a href="" onclick="get_help('<cfoutput>#help_item_name#</cfoutput>');"><img src="images/help_icon.jpg" /></a></div>

Issue occurs using CF9 and MSIE8. This may be normal behavior.

Cup size   
Select size then click on coffee cup.
This entry was posted in Coldfusion, Problems & Fixes, Snippets. Bookmark the permalink.