0
swal({
title: 'Please Select a contact to send money',
input: 'select',
inputOptions: {
'1': 'Jhon',
'2': 'Gemie',
'3': 'Paul'
},
inputPlaceholder: 'Select a contact',
html: 'Amount: <input id="amount" class="form-control swal2-input">',
preConfirm: function() {
return new Promise(function (resolve) {
resolve(
document.getElementById('amount').value,
)
})
}
onOpen: function() {
$('#swal-input1').focus()
}
}).then(function (result) {
swal(JSON.stringify(result))
}).catch(swal.noop)
上記のコードは結果としてテキスト入力値のみを表示しています。結果配列の選択値も取得できますか。私はSweetAlert2を使用します。ありがとう!!選択フィールドとカスタム入力は結果として入力値のみを表示します。sweetalert2