Consider the following code: particularly when "none" is selected. Using sweetalerts2
Swal.fire({ //
html: '
blah blah ',
input: 'select',
inputOptions: {
'none': 'Please select an option:',
'option1': 'First Option',
'option2': 'Second Option'
},
inputValidator: function(value) {
return new Promise(function(resolve, reject) {
if (value != 'none') {
resolve();
} else {
reject('You need to select an option');
}
});
}
}).then(function(theoption) {
// etc etc...
On selecting "none", there is a javascript error. On firefox console, for example, I get "uncaught exception: You need to select an option" I realise that I am probably la hopeless Newbee