Set field error in content manager edit view from plugin

System Information
  • Strapi Version: 4.1.5
  • Operating System: Mac OS
  • Database: Postgres
  • Node Version: 12.22.1
  • NPM Version: 7.21.0
  • Yarn Version: 1.22.17

Is there a way to programmatically set a field error in the content manager edit view from a plugin? I tried searching for a hook something from the helper plugin but had no luck.

I guess what I’m looking for is a way to provide custom validation methods in the edit view and I also want to set errors so the save button disables :man_shrugging:t2:

Hi @mattmilburn, I am looking for the same thing ! Did fin a way to disable the save button

Right now I assume there is only one submit button inside the Edit View so I selected with Javascript and disable it if it does not fit my custom field logic


let submitButton = document.querySelector("button[type=submit]") as any;

 if (data) {
          submitButton.disabled = true;
          submitButton.ariaDisabled = true;
        } else {
          submitButton.disabled = false;
          submitButton.ariaDisabled = false;