I don't understand how to add a textarea
type
in sweet
alert.
Similar to type: "input"
$('#saveBtn).click(function(){
swal({
title: "Enter your Name!",
text: "your name:",
type: "input",
showCancelButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true,
animation: "slide-from-top",
inputPlaceholder: "Write something" },
function(inputValue){
if (inputValue === false)
return false;
if (inputValue === "") {
swal.showInputError("You need to write something!");
return false
}
swal("Nice!", "You wrote: " + inputValue, "success");
});
});
This works fine. But if I use type: "textarea"
instead of type: "input"
This gives error like this:
sweetalert.min.js:1 Uncaught ReferenceError: logStr is not defined
Thanks for help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…