Put the stuff you want to have happen after the form loads either in
the response page from the form submission, or else put them as
something like an event handler on an element and have the form
response include some code to trigger the event.

If you submit stuff with the jQuery AJAX routines, those APIs give you
the ability to run functions when the xhr is complete.


On Wed, Sep 23, 2009 at 9:37 AM, Rick Faircloth
<r...@whitestonemedia.com> wrote:
> 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
>
>



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.

Reply via email to