Open geydson opened 5 years ago
Same here :cry:
how to resolve ?
i downt know,,
i tried
content: {
element: "input",
attributes: {
Placeholder: "State the justification ...",
type: "text",
required: "required"
}
it got required attribut, but seems not work at all
but the easiest way is
function warn() {
swal({
title: "A chosen product was not the cheapest!",
text: "To continue you will need to provide a justification, do you wish to continue? \ n \ nProducts:",
icon: "warning",
buttons: {
cancel: "Cancel",
confirm: "Confirm",
},
content: {
element: "input",
attributes: {
Placeholder: "State the justification ...",
type: "text",
required: "required"
}
},
closeOnClickOutside: false,
closeOnEsc: false,
}).then((value) => {
if (!value) { warn() }
});
}
warn();
it just repeat the sweet if value is empty,, still looking for other option to resolve,,
inputValidator: value => { if (!value) { return "You need to choose something!"; } }
swal ({ title: "A chosen product was not the cheapest!", text: "To continue you will need to provide a justification, do you wish to continue? \ n \ nProducts:", icon: "warning", buttons: { cancel: "Cancel", confirm: "Confirm", } content: { element: "input", attributes: { Placeholder: "State the justification ...", type: "text", } } closeOnClickOutside: false, closeOnEsc: false, }) .then ((value) => {
});
How to put content: {element: "input"}, as a required field, when clicking confirm?