- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018 12:14 AM
Hi,
I found "var attachments = document.getElementById('header_attachment_list_label');
if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none') " used in the onSubmit Catalog client script.
why below elements are used:-
1.document.getElementById()?
2.From where "header_attachment_list_label" id is getting?
Is any alternative to document.getElementById() method.
Thanks in advanced.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018 12:21 AM
Hi
1) document.getElementById() is a DOM manipulation method to get the element from HTML code with the Id. As id for every element is different it can be used to get that particular element by it's ID (more like a unique key).
2) When you go to a particular page, press f12 there you'll see the html page in console with id's from there it is taken
3) You can use g_form too.
Mark correct if it helps.
Regards,
Omkar Mone
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018 12:18 AM
Hi,
The easiest way to access a single element in the DOM is by its unique ID. We can grab an element by ID with the getElementById() method of thedocument object. document.getElementById(); In order to be accessed by ID, the HTML element must have an id attribute.
Regards,
Keyur
Please Hit ✅Correct(If it is a correct solution) or Hit ✅Helpful(If it is useful).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018 12:21 AM
Hi
1) document.getElementById() is a DOM manipulation method to get the element from HTML code with the Id. As id for every element is different it can be used to get that particular element by it's ID (more like a unique key).
2) When you go to a particular page, press f12 there you'll see the html page in console with id's from there it is taken
3) You can use g_form too.
Mark correct if it helps.
Regards,
Omkar Mone
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018 06:33 AM
3)which method g_form. should I use in catalog client script to verify the attachment presence?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018 06:36 AM
Hi
If the variable is not be accessed from client script so that time you need to use documnet.getElementById();