關於表單<form></form>

表單不要審查 novalidate

<form novalidate>

必填欄位 required

<input type="text" class="form-control" id="name" name="name" required>

正則表達是篩選 pattern

<input type="text" class="form-control" id="mobile" name="mobile" pattern="09\d{2}-?\d{3}-?\d{3}">

不送出表單 return false

<form onsubmit="return false">

<form novalidate>
    <div class="form-group">
        <label for="name">name</label>
        <input type="text" class="form-control" id="name" name="name" required>
    </div>
    <div class="form-group">
        <label for="email">Email address</label>
        <input type="email" class="form-control" id="email" name="email" required>
    </div>
    <div class="form-group">
        <label for="mobile">Mobile</label>
        <input type="text" class="form-control" id="mobile" name="mobile" pattern="09\d{2}-?\d{3}-?\d{3}">
    </div>
    <div class="birthday">
        <label for="exampleInputEmail1">Birthday</label>
        <input type="text" class="form-control" id="birthday" name="birthday">
    </div>
    <div class="address">
        <label for="exampleInputEmail1">Address</label>
        <input type="text" class="form-control" id="address" name="address" required>
    </div>

    <button type="submit" class="btn btn-primary">Submit</button>
</form>