How to hide or Disable Custom Field

Discussion in 'Customization & add-ons' started by subhash365, Nov 20, 2009.

  1. subhash365

    subhash365 New Member

    Joined:
    Nov 18, 2009
    Messages:
    6
    I have added a custom field called tax.

    It has a default value.

    What I want is the it should not
    be edited either by the admin or
    the user in the Edit User Form.
    ( Because it is one for all )

    It has a default value which can
    be edited in the add fields page only

    But it should be visible in the
    Edit User Form but cannot be edited.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Sorry not sure, why you need such field if it can't be edited?
  3. subhash365

    subhash365 New Member

    Joined:
    Nov 18, 2009
    Messages:
    6
    There are some fields in the Edit User form
    which needs to be filled only by admin.

    So by any chance or by mistake the
    admin should not edit that particular
    field because that field is used for tax
    calculation only any changed to this
    field will affect the required result.

    It field should only be seen but not
    edited by the admin in the user edit
    form, as it has a default value asigned
    to it. If admin needs to change, it can only
    be done through the add field page.

    I hope you understood the problem.
  4. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    You can disable it from editing by using javascript.
    Or else you could hide it with CSS by using rules like:
    Code:
    FORM INPUT[name="name_f"]
    {
    	visibility: hidden;
    }
  5. subhash365

    subhash365 New Member

    Joined:
    Nov 18, 2009
    Messages:
    6
    This seems not working.

    What is needed is
    When we add the field there are options
    under visibility of the field, but that is
    only for the user profile, not for the admin.

    Can we have one more option
    Display in Edit User form? ( in admin area >> add field )

    Don't Display
    Display and allow editing
    Display only, editing is not allowed
  6. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    Of course it's not working if you just copy-pasted the code :p
    You've to adjust it to your situation (read field name) and add it to the site.css file/
  7. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Sorry but this is still not clear. If this field can't be edited by admin and by user, I guess it will have the same value for all users correct?
    Then how you will use it?
    Will it just be displayed for user and admin? if yes I believe just templates modification will be enough in this situation.
  8. subhash365

    subhash365 New Member

    Joined:
    Nov 18, 2009
    Messages:
    6

    From Quote : If this field can't be edited by admin and by user,

    > > This field can be edited by the admin in the Additional Field page and not in the User Edit page when the admin browses for the user details

    From Quote : I guess it will have the same value for all users correct?
    Then how you will use it?

    > > Yes it has the same value for all the users. This will be used for tax calculations only.


    From Quote : Will it just be displayed for user and admin?

    > > Yes it will only be displayed for the user and also for the admin in the Edit User page
    ( But can be edited by the admin in the Additional Fields page,the default value )


    From Quote : if yes I believe just templates modification will be enough in this situation.

    > > what template modification has to be done?

    As I tried to find out, where to find the additional fields, have no clue as to where to find them in the code, and in which template

    And if css is used then I think logically that, it will also affect in the Additional Field page, in the admin area. Where the default values are supposed to be edited but also should only be seen in the Edit User page, correct me if I am wrong.


    The situation with pictures

    [​IMG]


    In the Edit User page when
    the admin browse for the member
    he sees this page

    [​IMG]


    What I want is this
    ( The Tax area has been manupilated
    in photoshop to show the effect which
    is to be needed )

    [​IMG]


    And this is what the user sees


    [​IMG]



    I hope this pictures have made the situiation more clear.


    Regards

    Subhash
  9. subhash365

    subhash365 New Member

    Joined:
    Nov 18, 2009
    Messages:
    6
    It is possible to do this or not?

Share This Page