How to use Sweet Alert to replace prompt function ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How to use Sweet Alert to replace prompt function ?

I used type: "input" to use swal as prompt but it's not working... Can you help me ? 😅

17th Jul 2017, 11:37 AM
Ekansh
6 Answers
+ 4
:D Well, I usually prefer write my own 'sweet cool' alert/prompt/confirm when I do not want use os modal built-in JS ones ^^ See how I integrate a complete and extended original JS class to replace the 3 built-in boxes in this code: https://code.sololearn.com/Wp8x1NemoYJ1/#html
17th Jul 2017, 2:18 PM
visph
visph - avatar
+ 5
https://code.sololearn.com/WlSiILvqHwd9/?ref=app Not a prompt replacement one, but an confirm: not difficult to adapt it by adding text field and returning its value (or reading it at anytime anywhere ^^) Feel free to request for help if you fail doing yourself ;)
17th Jul 2017, 11:54 AM
visph
visph - avatar
+ 4
@visph it's not sweet alert... I think ? 😶
17th Jul 2017, 12:55 PM
Ekansh
+ 3
@Ekansh: What are you calling << sweet alert >>? @@ Anyway, the prompt/input version: https://code.sololearn.com/WO2Mz12InjfP/?ref=app ^^
17th Jul 2017, 1:10 PM
visph
visph - avatar
17th Jul 2017, 2:10 PM
Ekansh
0
Swal ain't a thing
22nd Mar 2020, 12:41 AM
DrNefardio
DrNefardio - avatar