title: SweetAlert input validation
body: <p>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...</p>
  
  <p>Here is my code-</p>
  
  <pre><code>    swal({
       title:"Enter a Username",
       content: {
                  element: "input",
                  attributes: {
                      placeholder: "Type your username",
                      type: "text"
                       },
               },
  
  
      className: "mySwal"
      }).then((username)=&gt;{
              //get the username
              if(username){
  
              }else{
  
  
              }
  
  });
  </code></pre>