I was basically just trying to see if anyone else has had a problem after
applying that security patch. However code you wants code you gets. This is all
inside a bigger function but basically this first part send the form to my
AddToCartAJAX.cfm file which of course adds the item to their cart and it
returns the ID value for the item in the database.
My CFWindow has this naming convention. So where the #ID# is would be where the
ID column from the record is placed. The function callback(text) is where this
is breaking down. It is working fine until the line that says
ColdFusion.Window.show(ConfirmWindow) which as you can see from the code is the
name of the window. Like I said this has been working for over a year now and
now after this patch all the sudden it can no longer find the window to open
it.
I get this error ColdFusion.Window.show: Window not found, id:
AddToCartWindow54276
My cfwindow
<cfwindow center="true" closable="false" draggable="true" modal="false"
resizable="true" initShow="false" refreshonshow="true"
bodyStyle="background-color:white;" headerStyle="background-color:black;
color:white;" width="600" height="355" name="AddToCartWindow#ID#"
source="AddToCartWindow.cfm?PID=#ID#" title="Item Was Added To Your Cart"
destroyonclose="true"></cfwindow>
The AJAX call behind the scenes.
function submitCart(ID)
{
var frmName = "frm" + ID;
if(parseInt(document.getElementById(frmName).Quantity.value) <=
parseInt(document.getElementById(frmName).QtyInStock.value))
{
ColdFusion.Ajax.submitForm(frmName,
'http://www.domain.com/AddToCartAJAX.cfm', callback, errorHandler);
}
else
{
alert("Quanity you are ordering must be equal to or
less than the quantity in stock. \nPlease try ordering " +
document.getElementById(frmName).QtyInStock.value + " or less.");
}
}
The callback function.
function callback(text)
{
var results = text;
var ConfirmWindow = "AddToCartWindow" + text;
//console.log('running...');
//console.log(results);
if(results == 0){
alert("Callback: " + text);
}
else{
alert("Item was added to your cart.");
ColdFusion.Window.show(ConfirmWindow);
}
//console.log('done...');
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354375
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm