I'm trying to use SweetAlert 2.1.2 with the following configuration:
swal({
title: "My Event Title",
text: "My event message",
icon: "warning",
html: true,
closeOnClickOutside: true,
content: {
element: "input",
attributes: {
placeholder: "User text",
type: "input"
}
},
buttons: {
cancelMove: {
text: "Cancel",
value: "c"
},
sendConfirm: {
text: "Yes, continue",
value: "s"
},
}
},
function(value) {
switch (value) {
case "cancelMove":
swal("Move cancelled");
break;
case "sendConfirm":
swal("Sending confirmation ...");
break;
default:
swal("Good bye!!!");
}
});
But, I'm not getting the expected results of a text input and two buttons:
I think I'm following their configuration steps correctly. But, obviously I'm not.