Architect's Log

I'm a Cloud Architect. I'm highly motivated to reduce toils with driving DevOps.

button要素 formnovalidate属性

button要素のformnovalidate属性は、form要素のnovalidate属性と同じで、入力値の妥当性を検証しないことを意味します。form要素のnovalidate属性よりも優先されます。

使用例

start.html
<!DOCTYPE html>
<html lang="ja">
<head>
<title>Hello! HTML5></title>
<meta charset="UTF-8">
</head>
<body>
    <form action="./regeister.html" method="post" enctype="text/plain" id="order">
        <p>
            名前:<input type="text" id="name" required="required" />
        </p>
        <p>
	<button type="submit">検証あり</button>
        <button type="submit" formnovalidate="formnovalidate">検証なし</button>
        </p>
    </form>
</body>
regeister.html
<!DOCTYPE html>
<html lang="ja">
<head>
<title>Hello! HTML5></title>
<meta charset="UTF-8">
</head>
<body>
名前が入力されていません。
</body>

レンダリング

初期表示

[検証あり]クリック

[検証なし]クリック