Question
How can I hide or remove the subject and description fields on the submit a request form in the help center?
Answer
It's possible to hide the subject from your request form, but it's not possible to natively hide the description field.
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. However, you can use Javascript or jQuery to autofill and hide both subject and description fields.
To hide the subject and description fields using Javascript or jQuery
- Ensure that you've imported a jQuery library if you want to use jQuery statements in a theme in place of vanilla JavaScript.
- In Guide, click the Customize design icon (
) in the sidebar.
- From the theme you want to work with, click Customize.
-
Click Edit code and add the example code below in the script.js template.
$('.form-field.string.optional.request_subject').hide();// Hide subject
$('.form-field.string.required.request_subject').hide(); // Hide subject
$('.form-field.request_description').hide(); // Hide description
$('#request_subject').val('test subject'); // Autofill subject
$('#request_description').val('test description'); // Autofill description - Select Publish.
The created tickets will have the subject and description fields auto-populated as in the example below.
187 Comments
Ifra Saqlain Looks like it still has the attachment field showing.
@David Jetter,
Currently in your code, remove it:
Replace that line of code with given below:
Ifra Saqlain That did the trick, thank you so much for helping with this!
My pleasure Brett Sir! and I'm glad that it's working for David :)
Ifra Saqlain Shifting thought, do you know how to add fields to the subject without the subject being hidden? Looking to have the end user add the subject themselves, and then after clicking submit adding two dropdown custom fields to the subject line. I currently have:
But this doesn't work. Link to page is here. The two custom fields in question are dropdowns. Thanks in advance for any help you can offer!
@Teresa, try this code, add it to your script file --
i). When you have done with the code.
ii) Go to that form page > select value in the both dropdowns.
iii) Go to the subject field and type your title.
iv) Double-click on the subject field after writing the title.
v) Both dropdown field values will be added in the subject field.
Hope it helps you.
If any queries feel free to ask :)
Please sign in to leave a comment.