Newer
Older
hello-programmer-world / src / sample / php / form.html
@h.sakamoto h.sakamoto 8 days ago 1 KB php
<form method="post" action="submit.php">
    <div class="form-group">
        <label for="form_name">お名前</label>
        <input id="form_name" type="text" name="name" required>
    </div>

    <div class="form-group">
        <label for="form_address">住所</label>
        <input id="form_address" type="text" name="address" required>
    </div>

    <div class="form-group">
        <label for="form_products">応募する商品</label>
        <select id="form_products" name="product" required>
            <option value="">未選択</option>
            <option value="商品A">商品A</option>
            <option value="商品B">商品B</option>
            <option value="商品C">商品C</option>
        </select>
    </div>

    <div class="form-group">
        <input type="checkbox" id="form_agree" name="agree" required>
        <label for="form_agree">利用規約に同意する</label>
    </div>

    <button type="submit">送信</button>
</form>

<style>
.form-group { margin-bottom: 0.8em; }
.form-group:last-child { margin-bottom: 0; }
</style>