Avatar of slightlyoff
slightlyoff
 asked on

jQuery and Ajax, writing results to a div on a parent page

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!
JavaScriptAJAX

Avatar of undefined
Last Comment
slightlyoff

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
wellhole

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
slightlyoff

ASKER
you frickin' ROCK!  Thanks :)  

That was much easier than I was thinking it would be.

I really appreciate your quick response!
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23