I am trying to add a switch to a dialog using a sweet warning, but I cannot do this. Below is the code:
swal({ title: "<small>Please select an reason to cancel this job !</small>", type: "warning", text:"<input type=\"radio\" name=\"reason\" value=\"male\">Reason 1<br><input type=\"radio\" name=\"reason\" value=\"female\">Reason 2<br><input type=\"radio\" name=\"reason\" value=\"female\">Other Reason", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes", cancelButtonText: "No", closeOnConfirm: false, closeOnCancel: false, html: true }, function(isConfirm){ if (isConfirm) { swal("Result !","Job cancelled successfully."); } else { swal("Cancelled !", "Process aborted"); } });
source share