帮助中心 JavaScript 指南



image avatar

Charles Nadeau

Zendesk Documentation Team

已于 2025年3月28日 编辑


7

2

41 条评论

I'm looking for help on ticket forms in the Help Center V4.1 Version. We currently have a URL(spreadsheets) in the description of a custom field. This is added for our customer to reference the information on this page while filling out the form.

The issue we have discovered is that when the customer clicks on the link it opens the URL in the same window as the Help Center. 

Does anyone one know how to capture this via Javascript and force the link to open into a new tab within the users browser?

0


After upgrading to v4, accessing custom fields on the new request page using JavaScript or jQuery can be challenging since the previous field IDs (like custom_field_122222) are no longer available. Has anyone else encountered this issue or found a solution?

0


Hi everyone,

 

I'm struggling with the V4.0.2 template on a new brand we set up, to custom the request form. 

 

My script.js file doesn't have the function $(document).ready(function() 

I've tried several approaches and my changes aren't reflected, even adding the function near the bottom of the script .

 

What am I do wrong or missing?

 

Great community by the way. We customized a v2 template a while ago using solutions the community shared which works great.

 

Thanks

….

    // If there are any error notifications below an input field, focus that field
   const notificationElm = document.querySelector(".notification-error");
   if (
     notificationElm &&
     notificationElm.previousElementSibling &&
     typeof notificationElm.previousElementSibling.focus === "function"
   ) {
     notificationElm.previousElementSibling.focus();
   }
   
   $(document).ready(function(){
     $('label[for=request_subject]').html("Custom Subject");
      $('label[for=request_description]').html("Custom Description");
   }
                     
 });

})();
 

0


Hi 1900354501104 !

You could following the guide posted here

0


Is it possible to display all the articles under a section rather than having the “see all x articles” link?

0


Hi Kyle!
 
Glad to know you got the help you needed! Do feel free to reach out if you need more help!

0


Hello! This is informative. I have one question, is it possible to make the name entered by the user as the requester name?

0


1263082233249 that isn't quite what I was looking for, but that'll definitely come in handy. I was able to answer my own question here. Thanks!

0


We have a custom field that's a dropdown containing "Yes" and "No". I'd like to hide the attachments section if that dropdown is set to "No", but I can't seem to figure out the right if statement. Does anyone know if this is possible?

0


登录再写评论。