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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.