Add description to the Attachments field for "Submit a request" form
AnsweredAt the bottom of our "Submit a request" form in our Help Center is an automatic upload form for adding attachments. I would like to add a description similar to the description I've added to my other fields. The problem is, the Attachments field is not accessible in our Ticket Fields Admin Settings so I'm not able to add a description yet I am able to add one to all the other fields (i.e. Subject, etc). Below is an example showing our "Submit a request" form for context.
I looked at the HTML for our Help Center and found there is a template called "New Request Page" with a reference to "{{request_form}}" but I'm not sure how to access that or edit it.
-
Hi Vassilios, Yes, you can! Use this code and put it on the very bottom of Submit a request page code.
<script>
$('form#new_request .upload-dropzone').parent().append('<p>{{dc 'here goes DC item title'}}</p>');
</script>Note that DC item should be changed from my code above. Please try and let us know how it goes. ;)
-
Yup, we can put there another text. Just try to put this code on the bottom of your Submit a ticket page template.
<script>
$('div#upload-dropzone').prev().text('New text');
// change New text
</script>Let us know the result! ;)
-
Hi Eddie, yes that is possible ;) Try with this code, just paste it on the very bottom of your Submit a request page (New request) template. Don't forget to replace 123456 with the ID of your form.
<script>
if(window.location.href.indexOf("123456") > -1) {
$('div#upload-dropzone').parent().find('label').text('Please attach your proof of purchase below')
}
// replace 123456 with the 'hardware fault' form ID
</script>Let us know how it goes ;)
You should get something like this: -
Hello @... or anyone who can help !
Unfortunately, none of the codes listed on this thread has helped me. It would be helpful to see a screenshot of the HTML code where you are pasting these codes. I would like to just add a description below the Attachments field (see 2nd picture of example I'm trying to produce). The 2nd picture is from the link @... provided.
-
Hey, is this code will work in any way?
I've tried to paste that code to change the "Attachment" field in one of my forms, but it does not work:
<script>
if(window.location.href.indexOf("4420689591703") > -1) {
$('div#upload-dropzone').parent().find('label').text('Please attach your node logs')
}
</script>Is there any way to make the ticket unsubmittable if the user has not added the attachment?
-
Hey Larry and Jorge, please try this out and let us know the results! Paste it in JS tab, after "$(document).ready(function() {".
$('form#new_request .upload-dropzone').parent().append('<p>Your text here Your text here Your text here Your text here </p>');
-
Here is the code:
<script>
$('.form-field.request_custom_fields_111111 > label').text('new text');
// replace 111111 with your ticket field ID
// replace new text with a new name of the field
</script>Hope this helps!
-
Hi friends,
I've been trying to follow this along but not having much luck. I'm trying to adjust the text which is associated with the email field. Instead of saying "your email address" i want it to say "email address associated with your online account"
I'm not having much luck with the code suggestions in the comments on this article. Wondering if anyone out there might know how I can do this at all?
Best,
Amie
-
Hey Amie, it should work if you put this code at the end of your "New request page":
<script>
$( document ).ready(function() {
$('.form-field.request_anonymous_requester_email label').text('Whatever whenever');
});
</script>Do you know how to edit your theme files?
-
Hey Grant,
You could do this with some conditional code on your new_request page just before the script you have above.
Try something like this:
<script>
var ticketForm = location.search.split('ticket_form_id=')[1];
if(ticketForm == "YOUR_TICKET_FORMID_HERE") {
$('form#new_request .upload-dropzone').parent().append('<p>{{dc 'here goes DC item title'}}</p>');
}
</script>You could have a case for each form ID you wanted to cover.
Hope that helps! -
Is there a way to change the "Attachment" placeholder text for the dropzone based on the selection in a specific field? We're trying to change the text based on the user selection of one of the dropdown menus in our contact form. We're also using dynamic text, so we'd want to be able to set that up with the dynamic string.
Based, on what I've read in the comments, the following should work to replace the placeholder with dynamic text, right? But, how do we make it so it is displayed based on a user's selection (similar to a conditional field).
<script>
var ticketForm = location.search.split('ticket_form_id=')[1];
if(ticketForm == "YOUR_TICKET_FORMID_HERE") {
$('form#new_request .upload-dropzone').parent().append('<p>{{dc 'here goes DC item title'}}</p>');
}
</script>If that isn't possible, is there a way to add the line of dynamic text below the dropzone based on the user's selection?
-
Hi all,
I see this post is 2 years old
I'm trying to insert a description in default form attachment
Is there any change ? I Can't see any text appearing in attach description, used all tips in thread but with no luck
Thanks in advance for help
-
I am very happy to report that @...'s suggested script worked perfectly for my needs:
<script>
if(window.location.href.indexOf("123456") > -1) {
$('div#upload-dropzone').parent().find('label').text('Please attach your proof of purchase below')
}
// replace 123456 with the 'hardware fault' form ID
</script>Mine is not for a hardware fault report, but I needed custom text for the attachments field on just ONE form, not all of them. And now I have it. Thanks Vlad!
-
I am trying to check for form and a field drop down option is picked. And if those two options are picked then changes the text.
Here has what i have come up with
if(window.location.href.indexOf("123412") > -1 && $('.form-field.request_custom_fields_112313.val() = "Eligibility Letter"') {
$('div#upload-dropzone').parent().find('label').text('Attach copy of Letter (Required)')
} -
Hi Jason,
Add the below line in your JS code:-
$('#request-attachments-pool').parent()
.append(‘ADD_YOUR_DESCRIPTION_HERE’);Replace ADD_YOUR_DESCRIPTION_HERE with your description text.
I believe that would work.
Let us know if you have questions.
-
@Diziana,
That worked for me. Thanks!
Where do I go to learn how to do this kind of think on my own? How did you know what "#request-attachments-pool" is?
-
Where exactly in the js code do you add this? its it 2 lines or 1?
-
@Diziana
This no longer seems to be working. I am pasting it at the end of my JS page.
-
I was able to get this to work for me, but when I add the code to the JS file, it universally adds the description text to every form that we created. I want to add it to one specific form, not all of them.
Could someone help with that?
Thank you!
-
Hey Larry -
Welcome to the Zendesk Community! That's a good question. I've asked one of our support agents to weigh in; you should see a response from someone shortly.
-
Hi, can't I use the placeholders of the dynamic text for that?
-
Hi Vladan, it worked! Thanks a lot!
-
Woohoo! Thanks for the feedback, Vassilios!
-
Thanks, Vlad! You're awesome.
-
Hi Vlad,
How Could I add custom text field as attachment with some blank description placeholder ,because we want to rename that attachment field ,don't want to use the system attachment specific for some form
-
Hey Suman, just to check, which one of these you want to rename?
-
Yes Vlad , I am talking about this system attachment field, could we rename it or use other custom fields as attachment with some text field where some decription can be written
-
Hi vlad ,thanks for the reply ,I also want to know how to change the type of request system field name where the form names are showing in a dropdown under a. brand?
-
Just to make sure could you please send me a screenshot of that field?
-
this is the screenshot
the Type of henvendelse ----- the system dropdown for showing the form under a specific brand, we need to change the name for the field also
Please sign in to leave a comment.
82 Comments