Cardiff Council Content and design system

www.cardiff.gov.uk

Forms

selecting

Select fieldRadio buttonsCheckbox

layout

Message boxNavigation buttonsValidation and Errors

input

TextEmailTelephoneTextAreaSearch boxDateTimeRangeFileNumber

Telephone

A field for entering a telephone number.

How to use this component

This element should be used for adding a Telephone Number field to a form. This can have validation to check for a genuine telephone number.

The autocomplete attribute can be used to automatically populate the field with a value.  For example, completing the phone number field with the value saved in the users profile data.

The aria-label can also be used to provide a more desciptive label for screen readers if a normal label cannot be used, or is not descriptive enough.


Code Resource

<label for="tel" class="form_formLabelTitle">Telephone *</label>
<input type="tel" name="tel"  id="tel" class="form_formTextbox" title="Enter your telephone number" autocomplete="tel">
/* Input Fields and Label*/
.form_formTextbox {
    width: 100%;
    font-size: medium;
    margin-bottom: 15px;
    float: right;
    display: block;
    border-radius: 0px;
    border: 1px solid silver;
    padding: 2px 5px;
    border-radius: 6px;
    height: 49px;
    text-indent: 10px;
}

.formwrapper input:hover, .formwrapper input:focus {
    border: 1px solid #015b66;
    background: #f9f9f9;
outline: none;
}


.form_formLabelTitle {
    width: 100%;
    font-size: 1em;
    color: black;
    float: left;
    text-align: left;
    padding: 7px;
    padding-left: 0px;
}
/* END */

Working Example