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

Reply via email to