Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    138
    Plugin Contributions
    0

    Default How to make an account edit field read-only?

    I'm working in the file

    includeds/templates/YOUR_CUSTOM/templates/tpl_account_edit_default.php

    I would like to make one of the fields read only. For Example:

    <label class="inputLabel" for="fax"><?php echo ENTRY_FAX_NUMBER; ?></label>
    <?php echo zen_draw_input_field('fax', $account->fields['customers_fax'], 'id="fax"') . (zen_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?>
    <br class="clearBoth" />

    The problems I'm running into are:
    1) zen_draw_hidden_field - causes it not to be visible and updates the file to null

    2) <label class="inputLabel" for="fax"><?php echo ENTRY_FAX_NUMBER; ?></label>
    <?php
    echo $account->fields['customers_fax'];
    ?>
    <br class="clearBoth" />
    ****this portion prevents field from being edited but once you click update, the field gets updated to null******

    Please let me know if I can provide any other info that may be useful.

    Regards
    ZC 1.5.5
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: How to make an account edit field read-only?

    In the zen_draw_input_field call, change
    Code:
    'id="fax"')
    to
    Code:
    'id="fax" readonly="readonly"')
    or you might see how using disabled="disabled" affects it instead.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jul 2011
    Posts
    138
    Plugin Contributions
    0

    Default Re: How to make an account edit field read-only?

    Many thanks DrByte. I had actually seen this bit of code somewhere in all the searching I had done but ultimately didn't know how to implement such a simple thing.
    ZC 1.5.5
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

 

 

Similar Threads

  1. v154 How to make an account signup field required
    By textileinnovations in forum General Questions
    Replies: 4
    Last Post: 20 Jul 2015, 12:37 PM
  2. v139h How to make customer referral a required field during create account?
    By idc1 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 16 Jan 2012, 09:47 PM
  3. how to make country drop down in shopping cart page read only???
    By lastpirate007 in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 13 Dec 2007, 03:03 PM
  4. Edit/Update Account Doesn't Work after Adding a new Account Field
    By webomat in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 19 Apr 2007, 04:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg