I have been trying to add a placeholder in the company field of customer address edit form(edit.phtml) in Magento 2. Any suggestion or advice where should I be looking I looked into the block of 'Magento\Customer\Block\Widget\Company' but couldn't find anything helpful


getLayout()->createBlock('Magento\Customer\Block\Widget\Company') ?>
<?php if ($_company->isEnabled()): ?>
    <?= $_company->setCompany($block->getAddress()->getCompany())->toHtml() ?>
<?php endif ?>

enter image description here


2 Answers 2


Open vendor/magento/module-customer/view/frontend/templates/widget/company.phtml file and add placeholder attribute in input tag.

 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.

/** @var \Magento\Customer\Block\Widget\Company $block */
<div class="field company <?= $block->isRequired() ? 'required' : '' ?>">
    <label for="company" class="label">
            <?= $block->escapeHtml(__('Company')) ?>
    <div class="control">
            $_validationClass = $block->escapeHtmlAttr(
        <input type="text"
               id="company" placeholder="Company Placeholder"
               value="<?= $block->escapeHtmlAttr($block->getCompany()) ?>"
               title="<?= $block->escapeHtmlAttr(__('Company')) ?>"
               class="input-text <?= $_validationClass ?: '' ?>"

Clear cache: php bin/magento cache:clean

enter image description here

  • Its working well as earlier I was making changes in /vendor/magento/module-ui/view/frontend/web/templates/form/element so kinda confused
    – J. Doe
    Nov 14, 2019 at 16:25
  • This file is proper. So do not worry about that. Nov 16, 2019 at 4:28

You need to check this file for company field in vendor.


You can override this file here in your custom theme and you can change placeholder there.


Hope this will help you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.