Question
How can I hide or remove the subject and description fields on the submit a request form in the help center?
Answer
You can hide the Subject from your request form. However, the Description field cannot be hidden by default.
To hide the subject field from the request form
- Go to Admin Center > Objects and rules > Tickets > Fields.
- Open the Subject field.
- Under Permissions, select Customers can view.
- Select Save.
Customers won't see the subject field in the request form, but the field is visible in the customer portal.
When you use the Customers can view permission, the description of the ticket becomes the subject of the ticket.
235 comments
Tracy Scobba
What happened to all of the older comments on this topic? I'm looking for information on how to pull custom field text into my subject, and I believe it used to be here. Plus, I've done some searching in Google and several hits show as "page doesn't exist." Did Zendesk do a clean-up? I miss the old content.
0
Sam
Hi Tracy Scobba! I posted a comment covering this here. Hope it helps!
0
Dave Dyson
0
Tracy Scobba
Thanks, Sam but I worry about using the HTML target that will be going away. Can I do the same thing with a Web Hook?
0
Tracy Scobba
Has anyone got this error after making the changes to the java script? What's weird is that I don't get the error if I'm not logged in but I do if I am.
0
Sam
Hi Tracy Scobba!
You certainly can. I updated the instructions to reflect! The fields are essentially the same:
0
Brandon (729)
Thanks for reaching out! You could try using JavaScript to confirm required fields before submitting:
0
Tyler Rutledge
We have this working perfectly on many forms but when we use a URL to pre-fill certain fields on the form, the code to hide other fields stops working.
0
Tipene Hughes
Hi Tyler Rutledge,
Sorry for the delay in getting back to you!
Not sure if you're still experiencing issues with this, but if you are can you try running the code below on your end and let me know if that has any effect on correctly hiding the fields?
0
Tyler Rutledge
Hello Tipene Hughes!
Thanks for the support on this! I got this working but the same problem exists with this script. When I implement your suggested script, the fields are hidden correctly. Accessing the form via the normal link like: https://companyname.zendesk.com/hc/en-us/requests/new?ticket_form_id=4418185168269 works correctly.
As soon as you prepopulate any custom fields using the URL such as: https://companyname.zendesk.com/hc/en-us/requests/new?ticket_form_id=4418185168269&tf_360049698092=testemail@gmail.com, the subject and description show again.
0
Tipene Hughes
Hey Tyler Rutledge,
I'm going to create a ticket so we can troubleshoot this in a bit more detail. You should see a message come through shortly!
0
Adam
Brandon (729) Im facing the same issue, when you accidentially click submit, it unhides my fields I have hidden, can you share where to put that code that uses JS to confirm required fields before submitting? Thanks!
0
Brandon (729)
Hey Adam,
This is using the Mutation Observer and, as a general rule, this code should go inside a $(document).ready(function(){ //Code }); function to load with the page (using jquery).
Hope this helps!
Brandon
1
Adam
Hi Brandon (729) thanks very much. Apologies, im not massively knowledgable around this, should I be adding this to my new_request_page or to the script.js file?
Any pointers would be appreciated, thanks!
Adam
0
Brandon (729)
Hey Adam my pleasure!
The code itself should be added to the script.js file.
(you'll also need to install jQuery by following these instructions).
Let me know how it goes!
Brandon
0
Adam
Hi Brandon (729) - thanks, I still seem to be struggling - can you advise if this is correct? I have the document ready function in my script.js and I have the Jquery installed in my document_head.hbs as per the instructions, but still, when I hit submit on a form, it behaves the same way (red boxes showing required fields, and any hidden fields re-appear). Thanks in advanced for all your help.
Adam
0
Brandon (729)
Hmmm - let's try a different approach Adam:
This approach uses something called a Mutation Observer, that looks for changes in specific fields. If it doesn't see an update on a required field, it prevents the form submission from executing, thus preventing the 'error' that exposes your hidden fields.
This example looks specifically for a change in the checkbox (customfield_123456789) that indicates an attachment is required. Note - you'll want to replace the field IDs with your field IDs in both the CSS and JS
make sure to change the field ID in
var attachmentCheckboxField = ‘request_custom_fields_123456789’;
and
var formDropdownClass = ‘.request_custom_fields_123456789’;
Let me know how this goes for you. Please note that this also uses the already installed jQuery.
0
Tyler Rutledge
Hello Tipene Hughes!
I apologize for missing your previous reply and ticket about this. I would still appreciate the support on this request and our account assumption is enabled. Is it possible we could resume the conversation on this topic?
https://support.zendesk.com/hc/en-us/articles/4408882841498/comments/4419957278618
0
Shobbir Ahmed
Hey all,
I have very little experience of coding - where/how would I add code to hide the description field?
I have one form with conditional fields:
I want to get rid of the default description field only (changed to any other relevant info):
0
Ifra Saqlain
Hey Shobbir, first of all you need to remove the required condition from the description field, and then you can easily hide it with the CSS.
Remove require condition from description field: https://support.zendesk.com/hc/en-us/articles/4408846008218
Team
0
Shobbir Ahmed
Hey Ifra,
I am unable to make that field not required:
The conditional fields I have used don't include the description field but it always appears as it is a system field (from what I can understand).
Thanks for help
0
Brandon (729)
Hi Shobbir Ahmed -
Unfortunately the description field is required to have *some* content as you can't have a blank ticket. That said, you can prefill and hide the field using the instructions outlined in the article.
Hope this helps!
Brandon
0
Shobbir Ahmed
Hey Brandon (729) & Ifra Saqlain - I don't know where/how to deploy the code to autofill the description and hide it.
This is what my script shows:
Thanks
0
Ifra Saqlain
Hello Shobbir Ahmed :), follow the steps below:
1). Copy the below code snippet and paste it at the bottom of your script.js file.
It would prefill the description field and then hide that. If any confusion, feel free to ask.
Thanks
Team
0
Shobbir Ahmed
Thanks very much Ifra Saqlain - this is what I now have:
Is there any way to remove the highlighted part?
It also looks like the autofill part comes up when an end user submits a ticket:
I entered test2 in the 'Please specify ..' box but that shows only to agent on back end. I want the user's message to be displayed instead of the autofill 'hello users'
Thanks
0
Ifra Saqlain
Remove the previous JS code and add the below:
Give me some time and please share your public Help Centre URL, so I can see your new request page and will share the exact solution.
You have multiple forms and you want to hide the description field only on one form, not for all, right?
Thanks
0
Shobbir Ahmed
Thanks Ifra Saqlain - the description box is now completely hidden.
We have one form with conditional fields - which comes to 6 forms in total. We want the description field hidden for all forms which I have now managed to do.
The remaining issue is for one of our forms (Standard Request) we have a field called 'Please specify the details of your request' - we want to use this like the description field - so when end users submit a ticket the info will appear at the back end:
hello users should be replaced by the highlighted part.
the other option is to remove the description field from all the other forms and just have it on the 'Standard Request' form - not sure if this can be done with conditional fields.
Thanks
0
Ifra Saqlain
Hey Shobbir Ahmed,
Good Idea:
1). Remove the description box from all forms.
2). Only have it on the Standard Request form.
3). Change the label of the description box: Description to Please specify the details of your request.
Let's do this
Remove the previously shared JS code and copy-paste the below code:
Q. How can you get the ticket form ID?
A. Select your form "Standard Request" and see it in the search bar of your window.
Here, you will get the form ID in the searchbar.
Copy the ID > Remove 00000000 in the script code > Paste your form ID which you have been copied.
If any confusion feel free to ask :)
Thanks
0
Shobbir Ahmed
Hey Ifra Saqlain - thank you for your help. Still having some issues, this is the code I pasted:
The form ID I found here:
As mentioned I only have one form with fields which are overridden by conditional fields:
I copied the ID from the url as it doesn't show in guide:
Thanks for your help
0
Ifra Saqlain
I'll get back to you, at office yet :)
0