Cookies - We use cookies to help improve your experience of using our website. For more information about the cookies we use see our privacy page. If you continue without changing your cookie settings we assume that you are happy with our use of cookies. You can change your cookie settings at any time by following the instructions on our privacy page
<form><divclass="form-group"><fieldset><legend><spanclass="form-label-bold">What is your date of birth?</span><spanclass="form-hint">For example, 31 3 1980</span></legend><divclass="form-date"><divclass="form-group form-group-day"><labelclass="form-label"for="dob-day">Day</label><inputclass="form-control"id="dob-day"name="dob-day"type="text"inputmode="numeric"pattern="[0-9]*"minlength="1"maxlength="2"></div><divclass="form-group form-group-month"><labelclass="form-label"for="dob-month">Month</label><inputclass="form-control"id="dob-month"name="dob-month"type="text"inputmode="numeric"pattern="[0-9]*"minlength="1"maxlength="2"></div><divclass="form-group form-group-year"><labelclass="form-label"for="dob-year">Year</label><inputclass="form-control"id="dob-year"name="dob-year"type="text"inputmode="numeric"pattern="[0-9]*"minlength="4"maxlength="4"></div></div></fieldset></div></form>
Error handling
add a class of form-group-error to the surrounding <div class="form-group form-group-error">
the error message <span class="error-message">Choose an answer</span> goes after the <legend>
add a class of form-control-error to the <input> with the error
Example
HTML Snippet for date input error handling
<form><divclass="form-group form-group-error"><fieldset><legend><spanclass="form-label-bold">What is your date of birth?</span><spanclass="form-hint">For example, 31 3 1980</span></legend><spanclass="error-message">Error message goes here</span><divclass="form-date"><divclass="form-group form-group-day"><labelclass="form-label"for="dob-day">Day</label><inputclass="form-control form-control-error"id="dob-day"name="dob-day"type="text"inputmode="numeric"pattern="[0-9]*"minlength="1"maxlength="2"></div><divclass="form-group form-group-month"><labelclass="form-label"for="dob-month">Month</label><inputclass="form-control"id="dob-month"name="dob-month"type="text"inputmode="numeric"pattern="[0-9]*"minlength="1"maxlength="2"></div><divclass="form-group form-group-year"><labelclass="form-label"for="dob-year">Year</label><inputclass="form-control"id="dob-year"name="dob-year"type="text"inputmode="numeric"pattern="[0-9]*"minlength="4"maxlength="4"></div></div></fieldset></div></form><form><divclass="form-group form-group-error"><fieldset><legend><spanclass="form-label-bold">What is your date of birth?</span><spanclass="form-hint">For example, 31 3 1980</span></legend><spanclass="error-message">Error message goes here</span><divclass="form-date"><divclass="form-group form-group-day"><labelclass="form-label"for="dob-day">Day</label><inputclass="form-control"id="dob-day"name="dob-day"type="text"inputmode="numeric"pattern="[0-9]*"minlength="1"maxlength="2"></div><divclass="form-group form-group-month"><labelclass="form-label"for="dob-month">Month</label><inputclass="form-control form-control-error"id="dob-month"name="dob-month"type="text"inputmode="numeric"pattern="[0-9]*"minlength="1"maxlength="2"></div><divclass="form-group form-group-year"><labelclass="form-label"for="dob-year">Year</label><inputclass="form-control"id="dob-year"name="dob-year"type="text"inputmode="numeric"pattern="[0-9]*"minlength="4"maxlength="4"></div></div></fieldset></div></form><form><divclass="form-group form-group-error"><fieldset><legend><spanclass="form-label-bold">What is your date of birth?</span><spanclass="form-hint">For example, 31 3 1980</span></legend><spanclass="error-message">Error message goes here</span><divclass="form-date"><divclass="form-group form-group-day"><labelclass="form-label"for="dob-day">Day</label><inputclass="form-control"id="dob-day"name="dob-day"type="text"inputmode="numeric"pattern="[0-9]*"minlength="1"maxlength="2"></div><divclass="form-group form-group-month"><labelclass="form-label"for="dob-month">Month</label><inputclass="form-control"id="dob-month"name="dob-month"type="text"inputmode="numeric"pattern="[0-9]*"minlength="1"maxlength="2"></div><divclass="form-group form-group-year"><labelclass="form-label"for="dob-year">Year</label><inputclass="form-control form-control-error"id="dob-year"name="dob-year"type="text"inputmode="numeric"pattern="[0-9]*"minlength="4"maxlength="4"></div></div></fieldset></div></form>