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

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

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

해결됨

Using Rules Editor to limit number of attachments

Avatar

Level 3

I recently noticed that you can either select one or multiple attachments for an adaptive form. I would l ike to limit the number of attachments to 4. How can I do that?

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee

Simply use the following script in the validate event of the file attachment field. it works.

 

if(this.value.split("\n").length < 5)
  {
    true;
  }
else
  {false;}

 

Mayank_Tiwari_0-1633508804965.png

 

원본 게시물의 솔루션 보기

3 답변 개

Avatar

Employee Advisor

@lsmurph Can be handled but may require custom code. Let me see if I have one in the archive.

Avatar

Employee Advisor

@lsmurph use this on value commit of attachment: 

guideBridge.getFileAttachmentsInfo({
success:function(list) {
for(var i = 0; i< list.length; i++) {
// console.log(list[i].name + " "+ list[i].path);
if(list.length>4)
document.getElementsByClassName('button-default button-medium guide-fu-attach-button')[0].disabled=true;
}
}
});

Avatar

정확한 답변 작성자:
Employee

Simply use the following script in the validate event of the file attachment field. it works.

 

if(this.value.split("\n").length < 5)
  {
    true;
  }
else
  {false;}

 

Mayank_Tiwari_0-1633508804965.png