활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
i created a custom field in metadata schema. This field have validation like starts with capital M,S and follow with numeric (ex:MS123 accepted Ms234 error).
This field is not a required fields. if the user don't input any data it should save. if the user input some data/text and the data not follows the patten then we need to restrict the user in saving the asset details.
Please help...
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
Hi,
i checked on the html of every field. i found a difference if field have validation and we input the incorrect text/data this
aria-invalid="true"
will append to the html. i used aria-invalid attribute whenever if aria-invalid="true" the save&close/save should highlight error and should not perform save operation.
Hi @mahi1365 ,
For validation of the schema fields you can use the foundation validation API and add a regex pattern to validate your requirement.
Try the regex below for your requirement
^$|^MS+([\d])*$
https://medium.com/@theopendle/aem-custom-metadata-forms-for-assets-8c6597205f9d
Hope this helps.
validation is working fine. the field is not a required field. but when ever user enters wrong pattern it should restrict the user from saving.
^$|^MS+([\d])*$
In the above pattern the first part ^$ allows empty string, so empty value will allow saving and second part allows only the pattern, so wrong pattern will restrict the user from saving.
Hi,
i checked on the html of every field. i found a difference if field have validation and we input the incorrect text/data this
aria-invalid="true"
will append to the html. i used aria-invalid attribute whenever if aria-invalid="true" the save&close/save should highlight error and should not perform save operation.
조회 수
Likes
답글