getSCAttachmentCount(); function is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 04:02 AM
Hi,
We have an 'on submit' client script for making the attachment mandatory in portal.
Even after adding attachment also, the alert is showing like 'Please attach attachements'.
Can anyone help me?
We have used the below script
function onSubmit() {
var attachments = document.getElementById('header_attachment_list_label');
if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none' ) {
alert('Please attach attachements');
return false;
}
} catch(e) {
var count = getSCAttachmentCount();
if(count <= 0) {
alert('Please attach attachements');
return false;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 04:53 AM
Hi Anubhav,
Yes, we already checked that 'Isolate script' to true only, but we are still getting error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 05:01 AM
Hi @Pavan S
The alerts you have written are same could you please check which is one is getting logged.
Please mark helpful/correct if my response helped you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 06:05 AM
Hi Anubhav,
The second alert we are getting while submitting the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 06:15 AM
The Same script is working for Catalog items, but not for order guides.
Currently we need it for Order guide