Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

SweetAlert Configuration Confusion

$
0
0

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: enter image description here

I think I'm following their configuration steps correctly. But, obviously I'm not.


Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>