Nodral Posted February 15, 2013 Share Posted February 15, 2013 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); } Quote Link to comment https://forums.phpfreaks.com/topic/274522-jquery-modal-window-issues/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.