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

daftspunk picture daftspunk  路  4Comments

yrshaikh picture yrshaikh  路  4Comments

fracz picture fracz  路  4Comments

vmitchell85 picture vmitchell85  路  6Comments

voodoo6 picture voodoo6  路  4Comments