How to check for attachments on catalog item in client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 08:51 AM
I can't seem to get any solution I've seen on here work.
The latest one I've tried is:
if (this.document.getElementsByClassName('get-attachment').length == 0) { g_form.addErrorMessage(getMessage('attachment_mandatory')); return false; }
and I get the error: onSubmit script error: TypeError: Cannot read properties of null (reading 'document'):
function () { [native code] }
This catalog item is in a scoped application - is this likely what my problem is? If so, how can I replicate this for my scoped application so this works?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 08:55 AM
Hi @e_wilber,
Check out the below article from Ankur providing steps to implement including screenshots.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 10:51 AM
This post will solve your question: