validation text box code example

Example: validation text box

<form class="was-validated">
    <div class="row">
        <div class="mb-15 col-sm-6">
            <input type="text" class="form-control" placeholder="Valid state">
            <div class="valid-feedback">Looks good!</div>
        </div>
        <div class="mb-15 col-sm-6">
            <input type="text" class="form-control" placeholder="Invalid state" required="">
            <div class="invalid-feedback">This is required</div>
        </div>
        <div class="mb-15 col-sm-6">
            <textarea class="form-control" rows="2" placeholder="Valid state"></textarea>
            <div class="valid-feedback">Looks good!</div>
        </div>
        <div class="mb-15 col-sm-6">
            <textarea class="form-control" rows="2" placeholder="Invalid state"
                required=""></textarea>
            <div class="invalid-feedback">This is required</div>
        </div>
    </div>
</form>

Tags:

Misc Example