Hi,

I would really appreciate any reply/comments. Looking forward to
hearing from you.

Thanks.

Regards,

Christian

On Sep 14, 10:34 am, csetzkorn <c.setzk...@liv.ac.uk> wrote:
> Hi,
>
> I am struggling a bit with this. I am using the 'jQuery BlockUI
> Plugin' and the 'BabySteps' plugin (http://blog.vokle.com/index.php/
> 2008/08/22/babysteps/) where I go from step to step if the previous
> step validates ok. I have (simplified) code like this:
>
> step1.bindStep(step2, { nextValidator: step1_validator, transition:
> function(currStep, nextStep) { currStep.slideUp(); nextStep.slideDown
> (); } });
>
> function step1_validator() {
>
> $.ajax({
>                 url: "../a/b",
>                 type: "POST",
>                 dataType: "text",
>                 data: { },
>                 async: true,
>                 error: function(XMLHttpRequest, textStatus,
> errorThrown) {
>                     showErrorMessage(Server error " + textStatus + " "
> + errorThrown);
>                 },
>                 beforeSend:
>                 function(data) {
>                     $.blockUI({ message: 'Please wait ...' });
>                 },
>                 success: function(data) {
>                     data = JSON.parse(data);
>                     $.unblockUI();
>                     if( !(data.message=="") )
>                     {
>                         showErrorMessage(data.message);
>                         return false;
>                     }
>                     else
>                     {
>                         return true;
>                     }
>                 }
>             });
>
>         }
>
> The step1_validator should return true or false depending on whether
> thevalidationis ok of not. I have to use server sidevalidationand
> make anasynchronousrequest. Ideally I would like my 'mother
> function' (step1_validator) to wait for theasynchronousrequest to
> finish and return true or false depending on 'if( !
> (data.message=="") )'. I hope this makes sense. I can set async: to
> false but then $.blockUI({ message: 'Please wait ...' }); dose not
> work anymore.
>
> Looking forward to hearing from you.
>
> Best wishes,
>
> Christian

Reply via email to