Recent searches


No recent searches

Hide ticket fields in web widget

Answered


Posted Apr 22, 2020

Hi,

I would like to hide the email field in the web widget. I found this post: https://support.zendesk.com/hc/en-us/community/posts/360029388034-Hide-some-fields-from-the-widget- 

It redirects you to this post: https://support.zendesk.com/hc/en-us/community/posts/360004395348-Hiding-system-fields-in-Web-Widget  

Which I am not authorised to view. Can someone either help me with the js code, or give my access to view that post? 

Thank you,

Amy

**Added 9th June: Feature Request (https://support.zendesk.com/hc/en-us/community/posts/360046753854-Feature-Request-Hide-ticket-fields-in-web-widget)**


0

12

12 comments

image avatar

Devan La Spisa

Zendesk Community Manager

Hello @...,

The link you shared lead to an old EAP that is no longer live, sorry for the confusion. I've gone ahead and updated that post, so it shouldn't cause any more trouble. As for your question, I'll see if our Moderator team can offer a solution. Otherwise, I'll be sure to share this in our Weekly Digest so other members of the community can share their expertise. 

Best regards. 

0


Thanks @... - I look forward to see if anyone can help me out here :) 

0


@...

Try this code and see if it helps.

https://github.com/Ajhad1/Zendesk-Web-Widget-Modifications

0


@... - Thanks. Unfortunately I can't get it to work.

I am putting in the script.js file  and changed the below line to reflect the classes in my helpdesk

#Embed > div > div > div > form > div > div.sc-cpmKsF.fvnioU > div:nth-child(1) { 

But it isn't hiding the fields. I don't think it's finding the fields to start with.

Any guidance? Thanks in advance

0


@...

Make sure you are putting the code after the initialization of the widget. 

Note: This code is only run when the widget is opened. 

 

By default, I commented out all of the individual lines to make sure that the code does not have unintended effects.

Make sure you uncommented the section you are trying to use. 

 

The code should be added to the same place you are adding the initialization of the widget. You should not be inputting the file anywhere. 

 

I updated the documentation at the link to help explain this.

0


@... 

Yes, I missed that I had to put it after the widget. Thanks!

The bit that was breaking it for me is that in your code you have forgotten to close the function. Just in case any one else needs this code :)


Thank you so much on helping me fix days of torment! Much appreciated.

 

0


@...

I will update that right away. 

Glad the code helped you. 

 

I was tired of seeing the same requests for the past 5 years and Zendesk not doing anything about it.

0


Active Feature Request (please vote):

Feature Request: Hide ticket fields in web widget

@...

I just posted a Feature Request for this at the link below. If you would like to see this feature please head over there and show your support. Please make sure to add an upvote and comment even if it is simply a "+1"

Also, you may consider adding it to your post to get the feature request more visible.

https://support.zendesk.com/hc/en-us/community/posts/360046753854-Feature-Request-Hide-ticket-fields-in-web-widget

0


We solved this using this Javascript, where "xszt60-1.dLJShQ" is different for each widget.

<script type="text/javascript">
zE('webWidget:on', 'open', function () {
var style = document.createElement('style');
/*name*/
style.innerHTML = `.xszt60-1.dLJShQ > div:nth-child(1) {display: none;}`;
/*email*/
style.innerHTML += `.xszt60-1.dLJShQ > div:nth-child(2) {display: none;}`;
/*organization*/
style.innerHTML += `.xszt60-1.dLJShQ > div:nth-child(3) {display: none;}`;
parent.document.getElementById('webWidget').contentDocument.head.appendChild(style);
});
</script>

But I have a question: can this ID change at some point? Is this always like this for each Zendesk instance?

0


It gives me this error, with this script.

0


@...

Alejandro says:

The reason you were unable to find that repository as it was deprecated for a new one. https://github.com/Ajhad1/Zendesk-Customizations

Look under web-widget folder for the code you are looking for. 


0


Hi Team

 

Could you please provide an option to hide the nested ticket fields as well please? When we add nested fields (example- Field :: 1, Field :: 2, etc) and if we have to hide them, the field does not get hidden completely. The ‘Field >’ option will still show on the ticket page but it will be blank without options. This is confusing to the agents while selecting a ticket field for a ticket. Can you please enable the Ticket Field Manager app to hide the entire field when we add tags to hide options?

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post