Sweetalert: パスワードプロンプトを実装する

作成日 2015年03月19日  ·  5コメント  ·  ソース: t4t5/sweetalert

#5のフォローアップ

最も参考になるコメント

これは0.5.0リリースで閉じられます。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);
    });
  });

全てのコメント5件

これは0.5.0リリースで閉じられます。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);
    });
  });

@parterburnが言ったように、 inputTypeを使用するだけで、準備完了です。 また、入力機能の使用方法がわからない場合は、 SweetAlertチュートリアルを確認してください。

ポインタをありがとう、そしてノイズをお詫びします:)

これは実用的なソリューションです。 ありがとう :)

それは動作します👍

このページは役に立ちましたか?
0 / 5 - 0 評価