現在、個人的なプロジェクトに取り組んでいます。ユーザーがボタンをクリックすると、SweetAlert プロンプトが表示され、ユーザーが資格情報を確認できるようになります。しかし、SweetAlert の Web サイトにあるコードでは、1 つの入力フィールドしか使用できません。ここに私が持っているコードがあります:
swal({
title: "Authenicating for continuation",
text: "Test",
type: "input",
showCancelButton: true,
closeOnConfirm: false,
animation: "slide-from-top",
inputPlaceholder: "Write something"
}, function(inputValue) {
if (inputValue === false) return false;
if (inputValue === "") {
swal.showInputError("You need to write something!");
return false
}
// swal("Nice!", "You wrote: " + inputValue, "success");
});
では、2 つの入力フィールドを取得する方法はありますか? 1 つの入力フィールドはパスワード用で、もう 1 つの入力フィールドはテキスト用です。