Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

required property for alt text in image component does not work

Avatar

Avatar
Level 1
anilm50076901
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
anilm50076901
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
anilm50076901
Level 1

06-03-2020

Hi 

 

AEM 6.3

 

I have set "Alternative Text" under Accessibility tab of image component to mandatory (required true).

 

On form submission field gets highlighted but form submission continues.

 

Any help to fix this? i want to make Alt text field mandatory for image component.

 

image supertype: /wcm/foundation/components/image

View Entire Topic

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,348 likes

Total Posts

3,226 posts

Correct Reply

916 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,348 likes

Total Posts

3,226 posts

Correct Reply

916 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

09-03-2020

It should work, it could be a bug.

Anyways top of that you can add a extraclientlibs to validate img alt and stop dialog submit.

 

(function ($, $document) {
    "use strict";
    
    $(document).on("click", ".cq-dialog-submit", function (e) {
var $inputEle = $('[name="./alt"]');
if($inputEle !== null || typeof $inputEle !== "undefined")
{
var altValue = $inputEle.find("input.coral-Textfield").val();
if(altValue === "")
return false;
}
  }
});