How to use the sweetalert2.showValidationError function in sweetalert2

To help you get started, we’ve selected a few sweetalert2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RocketChat / Rocket.Chat / packages / rocketchat-livechat / .app / client / lib / commands.js View on Github external
}).then((result) => {
				if ((typeof result.value === 'boolean') && !result.value) {
					return true;
				}

				if (!result.value || result.value.trim() === '') {
					swal.showValidationError(t('please enter your email'));
					return false;
				}

				Meteor.call('livechat:sendTranscript', visitor.getToken(), visitor.getRoom(), result.value, (err) => {
					if (err) {
						console.error(err);
					}
					swal({
						title: t('transcript_sent'),
						type: 'success',
						timer: 1000,
						showConfirmButton: false,
					});
				});
			});
		}
github EmurgoHK / cardanoupdate / imports / modules / flagDialog.js View on Github external
}).catch(error =>{
          Swal.showValidationError(error)
        })
      },
github bknds / ng-pi-admin / src / app / pages / ui / components / notification / notification.component.ts View on Github external
setTimeout(() => {
            if (email === 'taken@example.com') {
              swal.showValidationError(
                'This email is already taken.'
              );
            }
            resolve();
          }, 2000);
        });
github zachd / ethereum-identity-research / app / javascripts / app.js View on Github external
function receiveRecoveryScan(parsed, type) {
  if(type === "contact-card" && parsed.uuid){
    swal.getInput().value = parsed.uuid;
    swal.clickConfirm();
  } else {
    swal.showValidationError("Error: Invalid QR code");
    setTimeout(function(){ swal.resetValidationError() }, 2000);
  }
}