Skip to content
Advertisement

SweetAlert input validation

I want the alert to not disappear when the user is trying to submit an empty form,instead it should show some error in the same alert.I tried doing swal.showInputError(“some error”) but it gives an error that it is not valid function.I tried looking at the documentation but cannot find any…

Here is my code-

JavaScript

Advertisement

Answer

You can use this function:

JavaScript

This will validates if the user is writing a value.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement