I want to achieve this and validate every element so none with left blank :
First name – with characters only
Last name – characters, hyphens and apostrophes only
Email – valid email addresses
Zip code – US zip validation
US States – a drop down list of states
This is my html code:
<section>
<div class="container form-container col-lg-12">
<form class="form_data" role="form" id="needs-validation" novalidate>
<h1 class="text-center"> Contact us </h1>
<div class="form-group center-block">
<label for="input--email" class="form-labels">Email address</label>
<input type="email" class="form-control form-control-lg" id="input--email" aria-describedby="emailHelp" placeholder="norman-geller@email.com">
<small id="emailHelp" class="form-text text-muted">Please provide to us a valid email adress.We won't shared it with anybody! We promise :) </small>
<div class="alert-feedback">
Please provide a valid email.
</div>
</div>
<div class="form-group center-block">
<label for="inputName" class="form-labels">name</label>
<input type="text" name="name" pattern="[a-zA-Z]+" class="form-control form-
control-lg" placeholder="Norman Geller" required="true" id="input--name">
<div class="alert-feedback">
Please input your name.
</div>
</div>
<div class="form-group center-block">
<label for="inputZipCode" class="form-labels"> Zip code</label>
<input type="number" min="5" max="5" name="zip code" class="form-control form-control-lg" placeholder="US zip code" required="true" id="input--zip">
<div class="alert-feedback">
Please input your zip.
</div>