Jump to content

JQuery modal window issues


Nodral

Recommended Posts

Hi All

 

I have a screen which opens a jquery modal window (from jquery ui). This contains a div, which I need to populate via ajax.

 

I have a fully working ajax function and can see the data being returned from the server. However I cannot get this to go into a div on the modal window.

 

Any thoughts? I thought maybe it was running the ajax prior to the modal window opening and therefore cannot find the div to populate. I've tried alsorts, but cannot get this to work. Any ideas guys?

 

$("#manualDialog").dialog({

   resizable: false,
   autoOpen:false,
   modal: true,
   width:1000,
   height:800,
   open: function(){
       getImages(worktype,'manualimages'); //function for getting the data from ajax
  	 },
   buttons: {
  	 'Continue': function() {
       $(this).dialog('close');
       var  plaincontentlength=0;
       var htmlcontentlength=0
       var defContent=$('#manualdefaultemailplain').val();
       var defHTMLContent=$('#manualdefaultemailhtml').val();
       var htmlcontent=$('#manualhtmlinput').val();
       var plaincontent=$('#manualplaininput').val();


       if(defContent==0){
      	 plaincontentlength=plaincontent.length;
      	 $('#manualplainsubmit').val(plaincontent);
       }else{
      	 $('#manualplainsubmit').val('');
       }
       if(defHTMLContent==0){
      	 $('#manualhtmlsubmit').val(htmlcontent);
      	 htmlcontentlength=htmlcontent.length;
       }else{
      	 $('#manualhtmlsubmit').val('');
       }
       var overridelength=plaincontentlength+htmlcontentlength;
       if(overridelength >0){
      	 $('#manualyes').show();
      	 $('#manualno').hide();
       }else{
      	 $('#manualyes').hide();
      	 $('#manualno').show();
       }
  	 }

   }//end buttons

   });//end dialog

function getImages(worktype,div){

   ajaxGet('worktypes.php?ajax=yes&worktype='+worktype,getImageCallback)


}

function getImageCallback(result){
   $('#manualimages').html(result);

}

Link to comment
https://forums.phpfreaks.com/topic/274522-jquery-modal-window-issues/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.