How can I make a callback function that delays the functioning of the last 4
lines below until after

the form that's submitted by this code is completely processed.  Images are
being processed

on the server side and that takes a few seconds.  Right now my response
dialog ( last line) is appearing

before the image processing is complete and if the "Close" button that is a
part of that response dialog

is clicked, then it interrupts the images processing.

 

So I need for the form to be completely processed before the response dialog
appears.

 

Thanks for any help and suggestions!

 

Rick

 

 

Here's the code:

 

function processAddRentalPropertyForm() {

 

      var addNewRentalPropertyForm = $('#addNewRentalPropertyForm');

 

      addNewRentalPropertyForm.submit(function(objEvent) {

 

            var jThis = $(this);

            var strName = ("uploader" + (new Date()).getTime());

            var jFrame = $("<iframe name=\"" + strName + "\"
src=\"about:blank\" />" );

 

            jFrame.css("display", "none");

            jFrame.load(function(objEvent) {

 

                  var objUploadBody =
window.frames[strName].document.getElementsByTagName("body")[0];

                  var jBody = $(objUploadBody);

 

            });

 

           $("body:first").append(jFrame);

 

            jThis   .attr("action",
"rentalProperties.cfc?method=mAddRentalProperty&returnFormat=json" )

                        .attr("method", "post")

                        .attr("enctype", "multipart/form-data")

                        .attr("encoding", "multipart/form-data")

                        .attr("target", strName)

 

      });

 

      var dialogPosition = $(window).scrollTop();

      var dialogPosition = dialogPosition + 100;

      $('.rentalPropertyAddResponseDialog').css('top', dialogPosition);

      $('.rentalPropertyAddResponseDialog').fadeIn(250);

 

}

 

----------------------------------------------------------------------------
---------------------------------------

"Those who hammer their guns into plows will plow for those who do not."  -
Thomas Jefferson

 

Reply via email to