Attachment mandatory condition through onSubmit client script is not working on Employee Center

Susmitha1625
Tera Guru

Hello Everyone,

 

We have an Onsubmit client script in the catalog item that checks if the attachment is added with the request or not and throws an alert message to add an attachment. This functionality is working in the native platform and in the Service Portal but the same script is not working in the Employee Center Portal. can anyone please suggest if any modifications are to be made for ESC portal. Thanks in Advance.

 

//Non Serviceportal
    try{
    var attachmentList = gel("header_attachment_list_label");
   
    if (attachmentList)
        {
        if (attachmentList.style.visibility == "hidden" || attachmentList.style.display == "none")
            {
            alert("Please add an attachment");
            return false;
        }
    }
    }
    catch(e){
        //service portal
       
        var count = getSCAttachmentCount();
if(count <= 0) {
    alert("Please add an attachment.");
            return false;
   
}
       
    }
1 ACCEPTED SOLUTION
1 REPLY 1