Ok thanks.....sounds good to me.

Will check it out.

Dave 

-----Original Message-----
From: MorningZ [mailto:morni...@gmail.com] 
Sent: January-12-10 4:42 PM
To: jQuery (English)
Subject: [jQuery] Re: Disable Submit

Personally i suggest using BlockUI to overlay the whole form... that way
1) not possible for your user to resubmit
2) gives dead obvious indication something is going on
3) simple as can be to use

On Jan 12, 2:49 pm, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> I have a form i am submitting via Ajax. So after submit while its 
> waiting for response i have my little spinner so user knows something is
happening.
> But how can i disable the submit while its "thinking" waiting for a 
> response so the user is not sitting there clicking submit over and over.
>
> Using this for my js as of now;
>
> $('#new_set').live('click', addRecord);
>
>  function addRecord() {
>
>  var data = $('#add').serialize();
>
>  $("#add").slideToggle('fast');
>  $('.flash').prepend('<div class="saving"></div>');
>  //$('#new_set').die('click');
>  $.ajax({
>   type: "post",
>          url: "/manage/awards/add",
>          data: data,
>          dataType: 'json',
>          success: function(response){
>    if (response.status === true) {
>     alert(response.status);
>
>      $('.saving').remove();
>
>    } else {
>                 //$('#new_set').live('click');
>     alert(response.status);
>     $('.saving').remove();
>
>    }
>   }
>  });
>     }
>
> I tried adding $('#new_set').die('click'); but then it never submitted.
>
> Thanks
>
> Dave
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/12/10
04:05:00

Reply via email to