0
0

More than 1 year has passed since last update.

input type number でeを入力させたくない

Posted at

サーバ側のバリデーションで1eなどのべき乗の数値がはいってくると期待するチェックができないことがある。
なので、そもそも入力できないようにする。

    $("input").keydown(function(e) {
        if ((e.which && e.which === 69) || (e.keyCode && e.keyCode === 69)) {
            return false;
        } else {
            return true;
        }
    });
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0