I have a web page with several links on it. When a link is clicked it pops up a jQuery modal box, with a form loaded from another page using ajax:
function getInfo(prodID){
$.ajax({
type: "POST",
url: "getProduct.asp",
data: "prodID=" + prodID,
timeout: 6000,
success: function(data, textStatus){
if (data!="ERROR")
{
$( "#dialog-form" ).html(data);
$( "#dialog-form" ).dialog( "open" );
}
else
{
}
}
});
return(false);
}
getprod.asp is a form that loads with specific fields. when the user clicks submit on the getprod.asp form, i want to process another ajax page (addtocart.asp) - and then update a div (#cartInfo) on the original page with updated cart information.
I'm not sure how to communicate from the getprod.asp's Ajax results to the parent page that launched the modal dialog box. $( "#dialog-form" ).html(data); is what I use to update the modal dialog box - and I imagine it would be something like - $this.$parent("#cartInfo").html(data); - but I don't know.
Any ideas? I don't know if I need to post more information.
Thanks for your help!
That was much easier than I was thinking it would be.
I really appreciate your quick response!