Add a custom disclaimer or note in a ticket form in your help center to add context or important information before users submit a request.
Disclaimer: This article is provided for instructional purposes only. Zendesk does not support or guarantee the code.
To add custom disclaimers
- Customize the JavaScript code of the help center theme
- Place the code below anywhere in the script.js tab, as long as it is after
$(document).ready(function() {
var selected = $('#request_issue_type_select option:selected').text(); if (selected == "Insert the name of your form to end users here") {
$('div.request_ticket_form_id').append('<p>Insert whatever disclaimer or note you want here!</p>');
} - If you want to add styling to the disclaimer, add an ID to the element then style the ID in the CSS of your template
$('div.request_ticket_form_id').append('<p id="disclaimer">Enter whatever disclaimer or note you want here!</p>');
- Under style.css, add the styling for your disclaimer. In this example, the disclaimer font is set to red
#disclaimer { color: red; }
Here's how it should like in the help center when a user tries to submit a form.
Note: jQuery is not provided by default. Make sure to import a jQuery library if you want to use jQuery statements in a theme in place of vanilla JavaScript. For more information, see the article: Importing or upgrading jQuery.
For more information, see the article: Customizing your help center theme.
15 comments
Georg
Many thanks for this very useful solution! The missing option to add text boxes to online forms is a massive limitation and this is a practicable workaround.
However, since we support several languages, I'd need to use it with a dynamic content placeholder. Is this possible? Simply replacing the HTML part of the disclaimer by a placeholder, for instance {{dc.placeholder_name}}, doesn't work.
[Edit: I solved it by simply making sure to use a different form name for each language and then assigning the corresponding text versions as suggested above.]
3
Karl Löfdahl
This doesn't work for me. I have added jQuery and placed the script in the script.js tab, after
I have replaced the "Insert the name of your form to end users here" with the name of my form.
Nothing changes.
0
Christopher Kennedy
When you select the form are you seeing any errors in the browser console?
Best,
0
Diana Iglesias Irvin
Could someone update this article to reflect the latest Copenhagen theme code? script.js no longer contains this:
Thanks!
0
Vlad
Hey Diana Iglesias Irvin, this should do the trick:
2nd step should be like this, add this code at the very end of your JS file:
Also, please make sure to add at the end of your document head this one (cause the new Copenhagen doesn't have jQuery library by default):
0
Andy F.
Is there a way to add a disclaimer or note like this to the form that doesn't involve editing the theme template? We just switched from an old and outdated custom theme to Copenhagen in order to receive automatic updates, but it looks like if we implement something like this we'll become a custom theme again and lose that benefit.
1
Josh
This method is actually needed if you want custom disclaimers for multiple ticket forms. For this, it will really involve custom coding.
0
mfg
Would there be a character limit to this element? We're currently struggling to incorporate larger texts into forms.
0
Nicole
Vlad How can you add this to the bottom of the form, between the attachment box and the submit button?
Or, how can I add it to the bottom of a field, but only display on certain forms? I have a field I need to do this to that is shared across almost all forms. BUT, I only need to add some text to it on one form.
0
Dave Dyson
You could make the disclaimer appear in multiple forms by adding additional checks in the if statement of the Javascript code example above -- for example:
if ((selected == "Form name 1") || (selected == "Form name 2")) {
You could add several forms that way.
0
Brian Dao
Hello!
I would like to know how to include a hyperlink in the disclaimer text. For instance "click here" with it linked to https://support.zendesk.com/ for example. Thank you!
1
Brian Dao
Also, would it be possible to frame the disclaimer text within a red box? Thank you!
1
Lexi Acosta
Hi there - is there a way to add a disclaimer to every article in our help center?
0
Lexi Acosta
Hi there - is there a way to add a disclaimer to every article in our help center?
0
mfg
Lexi Acosta
You can edit the article_page.hbs template from the Guide theming interface to include a banner on all article pages. Here's HTML instructions.
0