M
M
matveyboyko2022-02-01 23:35:50
Magento
matveyboyko, 2022-02-01 23:35:50

How can I access the product attribute fields in the Magento 2 admin panel from a custom module using CSS and JS?

In the product edit form (Catalog->Products->Product) I have 3 custom attributes: select and two datetime.
It is necessary for me at a choice in "No", to hide two others.
I'm trying to connect CSS and JS in a module (app/code/Namespace/Module/view/adminhtml/web/js/my_js.js) and attach an event to the select, but it doesn't work, apparently because the form is loaded by Javascript much later than the DOM .
Tell me, how can I "influence" form fields through JS and CSS in my module?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question