Sweetalert: Implement password prompts

Created on 19 Mar 2015  ·  5Comments  ·  Source: t4t5/sweetalert

Follow-up of #5

Most helpful comment

This is closed with 0.5.0 release, change the inputType:

  $('button.delete-account').click(function(e) {
    swal({
      title: "Are you sure you want to delete your account?", 
      text: "If you are sure, type in your password:", 
      type: "input",
      inputType: "password",
      showCancelButton: true,
      closeOnConfirm: false
    }, function(typedPassword) {
      console.log(typedPassword);
    });
  });

All 5 comments

This is closed with 0.5.0 release, change the inputType:

  $('button.delete-account').click(function(e) {
    swal({
      title: "Are you sure you want to delete your account?", 
      text: "If you are sure, type in your password:", 
      type: "input",
      inputType: "password",
      showCancelButton: true,
      closeOnConfirm: false
    }, function(typedPassword) {
      console.log(typedPassword);
    });
  });

As @parterburn said, just use inputType and you should be good to go! Also, feel free to check out the SweetAlert tutorial if you're unsure how to use the input features.

Thanks for the pointers, and sorry for the noise :)

It's a working solution! Thanks :)

it work 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adiwithadidas picture adiwithadidas  ·  4Comments

mateuszjarzewski picture mateuszjarzewski  ·  4Comments

VoxelNaut picture VoxelNaut  ·  6Comments

Lusitaniae picture Lusitaniae  ·  4Comments

fracz picture fracz  ·  4Comments