Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

503
Visualizações
Tinymce how to make the alternative description field for images required?

I am using tiny MCE version 5.8.2, sometimes the writers don't add the alternative description when they upload an image. So I would like to make the field required, so that to add the picture the alt must be filled.

I tried the a11y_advanced_options, but it's not what I want, this check are done after the image is added, I want that the form is not submitable until the field is not filled.

enter image description here

I'm thinking about writing a plugin to do it, but I don't know if it's the right solution.

How would you do it ?

about 4 years ago · Santiago Gelvez
2 Respostas
Responde à pergunta

0

A solution that might be effective, and make use of TinyMCE's existing APIs so you don't need to write anything custom, could be:

  1. Use the A11ychecker toggleaudit() method
  2. Pair this with a specific TinyMCE event, such as NodeChange, BeforeGetContent, and Change or similar event, like the click on the Save button.

The save button in the image dialog has a class of 'tox-button' and responds to the click event, so there may be a way to run the toggleaudit() method when these events happen. However, writing a short script to test this is reaching my knowledge limits.

It's a good question though, and quite possibly something that should be added as a design feature.

about 4 years ago · Santiago Gelvez Relatório

0

You don't describe how a user upload an image

If you use a filemanager get the filename and post with window.parent.postMessage

The in the file_picker_callback function add

// Provide image and alt text for the image dialog
if (meta.filetype == 'image') {
  callback(details.content, {alt: details.info.substr(0, details.info.lastIndexOf('.'))});
}
about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda