Skip to main content
Inspiring
March 14, 2008
Answered

<cfwindow>

  • March 14, 2008
  • 2 replies
  • 445 views
This is what the link looks like: abc.com/page1.cfm?myID=12355431

In page1.cfm, I'm using <cfwindow> via href:

<cfoutput query="">
...
<a href="##" onclick="javascript:ColdFusion.Window.show('MyWindow');">Text</a>
</cfquery>
...

<cfwindow
name="MyWindow"
center="true"
closable="true"
draggable="true"
height="200"
resizable="true"
title="#myQuery.ID#"
width="400">

<form name="te" action="yahoo.com" method="post">
<input type="text" name="name" value=""> <br/>
<input type="hidden" name="name" value="<cfoutput>#myQuery.ID#</cfoutput>"> <br/>
<input type="submit" name="submit" value="submit"><br/>
</form>
</cfwindow>

When I click "Text" link the first time, nothing happens, but the second time the <cfwindow> executes. After spending an hour and countless tries, I realized the only thing each instance had in common was the URL.

Initially the URL was: abc.com/page1.cfm?myID=12355431

After I click on the link the first time (when nothing happens), the URL looks like this: abc.com/page1.cfm?myID=12355431#

When I click the link again, the <cfwindow> works.

Does passing a var in the URL make <cfwindow> act odd? Why would it work if the URL was:
abc.com/page1.cfm#
abc.com/page1.cfm?myID=12355431#

But when the URL is:
abc.com/page1.cfm?myID=12355431
    This topic has been closed for replies.
    Correct answer AlwaysWannaLearn
    Hi everyone, thanks for looking at this. I checked in IE6 and FF2, and it points to an js error on prototype.js

    I did what any sane developer would do; instead of opening up prototype.js, rolling up the sleeves and drinking a pot of coffee to debug...I did a Google search instead.

    I came across: http://www.prototypejs.org/2008/1/25/prototype-1-6-0-2-bug-fixes-performance-improvements-and-security turns out there was a bug in the old version. I downloaded the latest version ran the page and viola, it works!!

    2 replies

    March 15, 2008
    Try this instead...

    <a href="##" onclick="ColdFusion.Window.show('MyWindow'); return false">Text</a>

    Or this...

    <a href="javascript:ColdFusion.Window.show('MyWindow'); return false">Text</a>
    AlwaysWannaLearnAuthorCorrect answer
    Inspiring
    March 15, 2008
    Hi everyone, thanks for looking at this. I checked in IE6 and FF2, and it points to an js error on prototype.js

    I did what any sane developer would do; instead of opening up prototype.js, rolling up the sleeves and drinking a pot of coffee to debug...I did a Google search instead.

    I came across: http://www.prototypejs.org/2008/1/25/prototype-1-6-0-2-bug-fixes-performance-improvements-and-security turns out there was a bug in the old version. I downloaded the latest version ran the page and viola, it works!!
    Inspiring
    March 14, 2008
    try changing your link to
    <a href="javascript:ColdFusion.Window.show('MyWindow');">Text</a>

    see if that helps.


    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/