Q: "Telephone" is a required value not working in customer edit form In my customer edit form, for telephone phone, required field validation is not working when I leave the telephone  field blank.
The required validation works for every field except for the telephone field.
When I save the form without telephone field, after the backend call it gives me a notification message " telephone" is required. Enter and try again.


This is code for password field in my form
<div class="field telephone required">
<label for="telephone" class="label">
    <span>
        Phone Number 
    </span>
</label>
<div class="control">
    <input type="text" name="telephone" id="telephone" value="" title="Phone Number" class="input-text " sr-only="INPUT" for="INPUT" aria-required="true">
</div>


I even checked eav_attribute table. It has is_required=1 for attribute_code='telephone'
I don't want notification, it should be like other fields inline validation.

A: You just need to add required-entry class in the input field as:
<input type="text" name="telephone" id="telephone" value="" title="Phone Number" class="input-text required-entry" sr-only="INPUT" for="INPUT" aria-required="true">

Its working fine for me.

A: looks like the vendor code was faulty,
They were adding _validationClass by using getAttributeValidationClass of fax
vendor/Magento/module-customer/view/frontend/templates/widget/telephone.phtml
<div class="control">
    <?php
        $_validationClass = $block->escapeHtmlAttr(
            $this->helper('Magento\Customer\Helper\Address')
                 ->getAttributeValidationClass('fax')
        );
    ?>
    <input type="text"
           name="telephone"
           id="telephone"
           value="<?= $block->escapeHtmlAttr($block->getTelephone()) ?>"
           title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>"
           class="input-text <?= $_validationClass ?: '' ?>"
    >
</div>

As required-entry class is missing so,
Just change it to ->getAttributeValidationClass('fax') to 
->getAttributeValidationClass('telephone') and it will work. 
