I'm having a enabled field in admin/customer/index/new but when forward to admin/customer/index/edit/id/{id}, I'd like to have it disabled. It'd be great if done in PHP.

I notice that both using base/ui_component/customer_form.xml

  • customer_index_new is your custom created layout ?
    – Msquare
    Apr 23, 2020 at 5:40
  • no mate, I haven't created anything. Apr 23, 2020 at 7:48

1 Answer 1


I'm finally able to disable it using js, so I leave the solution here.

require(['jquery', 'uiRegistry'], function ($, uiRegistry) {
        $(window).on('load', function () {
            var url       = window.location.href;
            var arguments = url.split('/');
            if (jQuery.inArray("id", arguments) !== -1) {
                uiRegistry.get('customer_form.areas.customer.customer.password', function (element) {
        }) });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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