내 커뮤니티 업적 표시줄을 확대합니다.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

Is there a recommended way to write custom js to make a field say pathbrowser inside a multifield as a requied field based on a condition?

Avatar

Community Advisor

Is there a recommended way to write custom js to make a field say pathbrowser inside a multifield as a requied field based on a condition?

We can use- .attr("aria-required", "true"); to make the fields required , but what would recommended structure of the js be?

Also what would be the best practice to achive this?

4 답변 개

Avatar

Community Advisor

Hi,

You can check the implementation at https://aemlab.blogspot.com/2019/05/aem-touch-ui-component-dialog-field.html for field validation.

 

Arun Patidar

AEM LinksLinkedIn

Avatar

Community Advisor

@arunpatidar  Awesome article 👌. Thanks for sharing.

Avatar

Community Advisor

@arunpatidar Is there a way to apply required property based on condition ?, say its optional at first and based on the checkbox on the dialog , the fields are made required and that field is inside a multifield. Similar to the min-max that applies to the whole multifield, whereas, here it is one of the field inside the multi-field.

Avatar

Community Advisor

Hi,

It is possible to do that based on condition. In your javascript check the dependent field as well and based on both field show/hide error.

Arun Patidar

AEM LinksLinkedIn