How to set Customer Email / Confirm Email Field readonly

Discussion in 'Tips and tricks' started by GermanHero, Feb 14, 2019.

  1. GermanHero

    GermanHero New Member

    Joined:
    Nov 15, 2018
    Messages:
    9
    Likes Received:
    0
    S.E:
    2019-11-15 18:56:17
    L.T:
    Regular
    L.C:
    1
    Hello!

    i want to set the Email and Confirm Email Fields readonly at
    https:/xxx.com/customer/index.php/account/index

    but i somehow cannot find where to do this in the source
    i thought in apps/backend/views/customers/form-php
    but how to set the fields to readonly ?
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,037
    Likes Received:
    2,343
    So you have:
    PHP:
    <div class="row">
        <div class="col-lg-6">
            <div class="form-group">
                <?php echo $form->labelEx($customer'email');?>
                <?php echo $form->emailField($customer'email'$customer->getHtmlOptions('email')); ?>
                <?php echo $form->error($customer'email');?>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="form-group">
                <?php echo $form->labelEx($customer'confirm_email');?>
                <?php echo $form->emailField($customer'confirm_email'$customer->getHtmlOptions('confirm_email')); ?>
                <?php echo $form->error($customer'confirm_email');?>
            </div>
        </div>
    </div>
    To make them read only, do:
    PHP:
    <div class="row">
        <div class="col-lg-6">
            <div class="form-group">
                <?php echo $form->labelEx($customer'email');?>
                <?php echo $form->emailField($customer'email'$customer->getHtmlOptions('email', array('readonly' => 'readonly'))); ?>
                <?php echo $form->error($customer'email');?>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="form-group">
                <?php echo $form->labelEx($customer'confirm_email');?>
                <?php echo $form->emailField($customer'confirm_email'$customer->getHtmlOptions('confirm_email', array('readonly' => 'readonly'))); ?>
                <?php echo $form->error($customer'confirm_email');?>
            </div>
        </div>
    </div>
     
  3. GermanHero

    GermanHero New Member

    Joined:
    Nov 15, 2018
    Messages:
    9
    Likes Received:
    0
    S.E:
    2019-11-15 18:56:17
    L.T:
    Regular
    L.C:
    1
    Thank you for your answer but somehow after i edited the
    /apps/backend/views/customers/forms.php

    it sill is editable when i click on a customers profile

    best regards
     
  4. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,037
    Likes Received:
    2,343
    /apps/customer/views/account/index.php
     
  5. GermanHero

    GermanHero New Member

    Joined:
    Nov 15, 2018
    Messages:
    9
    Likes Received:
    0
    S.E:
    2019-11-15 18:56:17
    L.T:
    Regular
    L.C:
    1
    thanks again!
     

Share This Page