Hi,
Please forgive my lack of knowledge here. I've looked at the advice for hiding the upload attachment area of the ticket form on Guide on multiple threads and comments and have a bit of code that has worked for other users however it does not seem to work and the script has changed significantly since then and I can't see any newer guidance on how to hide this area.
As per the guidance, I'm adding this code to my script.js
// hide attachments
if (window.location.href == "https://XXbrandURLXX.zendesk.com/hc/en-gb/requests/new?ticket_form_id=XXumber hereXX") {
$('.form-field label:contains("Attachments")').hide();
$('#upload-dropzone').hide();
However in preview it is not working. I can't switch off the option in overall settings as we still want attachments; I just don't want it on this specific form that sits on another brand within our ZD.
Thank you for sharing the details of your issue.
The approach of using JavaScript in script.js to hide the attachments section on a specific ticket form can be tricky, especially with recent changes to Zendesk’s scripts and form structure. The selectors and script behavior may have evolved, which could cause the code to no longer work as expected.
Here are a few suggestions that might help:
If you continue to face challenges, providing additional context or screenshots may help the community assist you further.
I hope this helps point you in the right direction!