You can have input in the standard SweetAlert style if you set the html property to true. The problem is that if the type is not set to "input", SweetAlert adds display: none fields for input.
This is a bit of a workaround, but you can change this in the js file from
<input type=\"text\" tabIndex=\"3\" />\n
to
<input id=\"swalInput\" type=\"text\" tabIndex=\"3\" />\n
And change the css file from
.sweet-alert input {
to
.sweet-alert #swalInput {
Then you can simply add your html to the text parameter when called, for example:
swal({ title: "Log In to Continue", html: true, text: "Username: <input type='text'><br>Password: <input type='password'>" });
This method simply indicates that the only input that will be created this way is the one generated by SweetAlert, so any inputs you add to the text will not be affected by this style.
Daftdeath
source share