1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

すべてのformにnovalidateを追加するブックマークレットのご紹介

Last updated at Posted at 2015-07-23

novalidateの存在を知って、書いて、調べて、車輪の再発明を知る。

Disable HTML5 form validation with novalidate!

Bookmarklet to disable HTML5 Form Validation

いや、あるはずだということはわかっていましたけどね。

自分が作ったのは↓でした

javascript:
var forms = document.getElementsByTagName('form');
Array.forEach(forms, function(item){
  item.setAttribute('novalidate', '');
});

参考:配列ライクなオブジェクトをforEachするときのイディオム - ぷちてく - Petittech

document.formsなんて…ずるい…

サーバーサイドvalidationの動作テストに便利だと思います。
けど、そんな感じに使っている検索結果が出ないので、皆さんは実際どうやってるんでしょうね?

自分は一度、自分で導入したrequired属性をインスペクタで一つずつ消してバリデーションの動作テストをするのに心底うんざりしました。
でもあるとユーザーとしては便利ですよね…

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?