Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
166
rated 0 times [  168] [ 2]  / answers: 1 / hits: 108303  / 9 Years ago, thu, july 16, 2015, 12:00:00

Currently working on a personal project. I want the user to click a button and a SweetAlert prompt would be presented for the user to verify their credential. However, the code I see on the SweetAlert website only allows one input field. Here is the code I have:



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);
});


So, is there a way I can get two input fields? One input field for the password and the other input field for text.


More From » prompt

 Answers
16

As far as I know you can't do this off-the-shelf. You can either fork and implement, or just use a HTML element as a modal (e.g. as in Bootstrap's modals).


[#65778] Tuesday, July 14, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kennedi

Total Points: 702
Total Questions: 109
Total Answers: 111

Location: Vietnam
Member since Sun, Oct 18, 2020
4 Years ago
;