$('#btn-forgotten').on('click', function(event) {
  event.preventDefault();
  $('#btn-forgotten').attr('disabled', 'true');

  $.ajax({
    url: $('#form-forgotten').attr('action'),
    type: $('#form-forgotten').attr('method'),
    dataType: 'json',
    data: $('#form-forgotten').serializeObject(),
  })
  .done(function(json) {
    // console.log('success');
    if (json['error_warning']) {
      notificationMsg(json['error_warning'],'warning');
    }
    if (json['success']) {
      notificationMsg(json['success'],'success');
    }
  })
  .fail(function(json) {
    // console.log("error");
  })
  .always(function(json) {
    // console.log('complete');
    $('#btn-forgotten').removeAttr('disabled');
  });
});
