Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

512
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!