Architect's Log

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

input要素 form属性

form属性は、そのフィールドの属するフォームを示します。この属性により、フィールドをフォームの外に配置することができるようになりました。

使用例

start.html
<!DOCTYPE html>
<html lang="ja">
<head>
<title>Hello! HTML5></title>
<meta charset="UTF-8">
</head>
<body>
    <form action="./next.html" method="post" id="order">
        <p>
            ユーザーID:<input type="text" id="userid" />
        </p>
    </form>
    <p>
    <input type="submit" value="送信" form="order" />
    </p>
</body>
next.html
<!DOCTYPE html>
<html lang="ja">
<head>
<title>Hello! HTML5></title>
<meta charset="UTF-8">
</head>
<body>
    <p>ユーザーIDが入力されました。</p>
</body>

レンダリング

初期表示

送信ボタンクリック