I am wondering if it possible to allow both select dropdown list and a input textarea within the same sweet alert.
For example: my select list have 4 options and the last option is others. I want when user choose others and it will display a text area for the user to enter. I am using similar to what sweetalert 2 give as shown below.
swal({
title: 'Select field validation',
input: 'select',
inputOptions: {
'apples': 'Apples',
'bananas': 'Bananas',
'grapes': 'Grapes',
'Others': 'Others'
},
inputPlaceholder: 'Select a fruit',
showCancelButton: true,
inputValidator: (value) => {
return new Promise((resolve) => {
if (value === 'oranges') {
resolve()
} else {
resolve('You need to select oranges :)')
}
})
}
})
if (fruit) {
swal('You selected: ' + fruit)
}