0

In the customer/edit page (adminhtml) I set up some custom fields, they appear by default under information account tab.

I created an observer (event is adminhtml_block_html_before), and I need to remove the fields from the form. I see there is a removeField method I could use, but I cannot find any explanation on how to do it from the observer.

1

you can try this

$this->getForm()->getElement('content_fieldset')->removeField('content_heading');

or this

// Remove the elementId from the form
$this->getForm()->removeField('password_fieldset');
// Remove the fieldset
$this->getForm()->getElements()->remove('password_fieldset');

or you can just disabled it

$event = $observer->getEvent();
$form = $event->getForm();    
$form->getElement('is_active')->setData('disabled', true);

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.