how to implement multiple inputs in Swalt.js | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to implement multiple inputs in Swalt.js

I'm going to write a card creation site and I'd like the user to enter the title and text of the card and I could get these values

23rd Dec 2022, 7:29 PM
Артур Хромов
4 Answers
+ 3
It look like it is not possible, I checked documentation, githube code, internet questions... but I managed to find out how swalt.js work under the hood, so I added another input manually. https://code.sololearn.com/WRiy56D6NboZ/?ref=app Basically swalt.js create html div element(alert modal) and append new elements like title, input, button, description.... I found what id-s and className-s they are using and add my input element
23rd Dec 2022, 8:42 PM
PanicS
PanicS - avatar
24th Dec 2022, 12:43 AM
Calviղ
Calviղ - avatar
+ 2
There isn't an example for adding multiple inputs even in their homepage https://swalt.netlify.app/ You would *probably* have to author your own custom alert box for that ...
23rd Dec 2022, 8:31 PM
Ipang
+ 1
Calviղ if I am not wrong it is diferent library(sweetalert2), but you are right for this case it is better option. Because it support much more then swalt.js
24th Dec 2022, 9:31 AM
PanicS
PanicS - avatar