Changing field order in HC

70 コメント

  • Brandon

    I'm trying to do this using that code, but it doesn't seem to be working. We start our request with the user choosing from a dropdown list of options. After that, all of the different fields appear. I want to reorder them from that point, but no matter where I put the code, it doesn't update anything.

    0
  • Jill Sandford

    WOW!  I am really in the dark on this one. haha!

    Where are the fields in HS?  What does that stand for?

    Where is the JS tab?  What does that stand for?

     

    0
  • Brandon

    @Elizabeth: I updated the fields to match what we have on our form. Since you have to first select a form, I didn't know if there was additional code that needed to be used in order for it to know which form to be changing, if that makes sense.

    0
  • Elizabeth Toy

    That makes sense, but there shouldn't be additional code needed. On our Help Center the form fields rearrange using the code, even with having multiple forms to select from the drop-down.

    Could you send a screenshot of your JS page and the form you're trying to move the labels on? :)

    0
  • Jennifer Rowe
    Zendesk Documentation Team

    Thanks for helping out here, Elizabeth!

    0
  • Jessie Schutz
    Zendesk team member

    Hey Jill!

    I think you meant HC...that stands for Help Center. This tip is showing how to re-arrange the fields that appear in the ticket form your customers can use to submit tickets to your Zendesk.

    JS stands for JavaScript, which is a type of code you can use to customize the look and behavior of your Help Center. You can find that code in your General settings, but I don't recommend doing anything with it unless you have in-depth knowledge of coding!

    0
  • Matthieu ETIENNE

    HI,

    Thanks for this solution.

    I wondering to know, in case of multiple contact Form, using different custom fileds, if there is a way to personalize each of them, using such code?

    So for example. My help center is offering 2 Forms (Form 1 & Form 2)

    In the Form 1 we found a custom Field "Field 1" only avalaible for the Form 1,

    Additonnaly, I have a "Field 2", only avalaible for the Form 2.

    In the 2 cases, I want to switch the ticket field Field 1 & Field 2 before "Subject" 

    Is it possible? How can I do it? 

     

    Thanks in advance for your help

    0
  • Matthew Tullo

    I have used 5 instances of this code to move some drop down fields above the subject in different forms.  All the fields I needed to move have moved correctly, but one of the drop down fields will not display its selections.  All others that have moved in the other forms work great.  I cannot find anything different with this form or field then the others.  Has anyone seen this happen or have any suggestions on how to fix it?

    0
  • Cameron D.

    +1 on @Matthew Tullo's issue

    I have tons of fields all working with the Conditinal Fields app -- had to add each one to move everything above Subject, and they all moved but some no longer display their selections, or no longer bring up another field after a selection is made.

    0
  • Jessie Schutz
    Zendesk team member

    Thanks for sharing your variation, Au!

    0
  • Nguyen Le Minh Quan (Johan)
    Guide to sort fields in ticket form. 
    I want to place the descriptive field down to the
    bottom of the template.
    I have read tutorials but can not follow.
    Can you help me edit or guide me?
    Thanks!


    0
  • Brad Ladwig

    While Customer Advocacy is not able to assist with custom code, I'm happy to provide a little guidance based off of your screenshot.  You'll want to click on the "JS" tab to start.  One on the JavaScript page the string of code mentioned would be placed just below the first line:

    $(document).ready(function() {

    and then modify accordingly.  A helpful practice when modifying code is to copy/paste the default code onto an external document so you have a backup incase things go awry.  Good luck!

    0
  • Chris Ratner

    Hi Au Finh Saechao. I really like the elegance of your solution. However, my custom forms with conditions is not working with this code added. I appended (copied and pasted) both of your pieces of code to the bottom of CSS and JS as noted above, but yet all my conditional form fields are exhibiting the same problem with this code. All the fields appear. Maybe I did something wrong. Screens below. Thoughts?

    https://www.dropbox.com/s/khbe6065nqxj1p9/zd_fieldorder.png?dl=0 

    0
  • Au Finh Saechao

    @Chris Ratner, Thanks! Can you link us to the live help center? It's possible that your instance has different element names/ids. 

    0
  • Chris Ratner

    Hi Au Finh Saechao. Thanks for the prompt reply. I'm afraid at I don't know how to "link you" to the live help center. Is there something I can brush up on to figure it out, or maybe here is a screen shot I can share. Thx.

    0
  • Jessie Schutz
    Zendesk team member

    Hi Chris!

    I think Au just meant, if your help center is available to the public (ie: non-logged-in users) they'd like the URL so they can take a look at it.

    0
  • Chris Ratner

    Thanks, Jessie and Au. I'd be more than happy to setup a remote session where I can show you my screen if that would help you take a look at our site -- would that work? Once we walk through, I'll update the comments with the results. Feel free to tweet me directly @cratner and we can go from there. Thx.

    0
  • Martin Sachs

    I have the same experience as @Chris Ratner.  It works from a rearrange standpoint but all the conditional fields show now.  Was there any progress outside of these public comments?

    0
  • Andrea Saez

    Hey all, 

    Keep in mind this article is now 2 years old and Zendesk has made several updates to the Help Center. This means it's likely the CSS element names have changed. To figure out the changes, right click > inspect element and sync up to the new element names, ie "request_anonymous_requester_email" if anonymous is request, for example.

    0
  • Noémie Dumez

    Dear Zendesk team and users, I am tryning to modify the order of the ticket field in my contact form too. I would like to :

    -put a personalized ticket called "Type" before the system field "subject".

    -place a personalized field called "Pays" (country") before the system field "description".

    I have added these lines at the end of the JS code...but it doesn't seem to work.

    $('#new_request.request-form label:contains("Type")').parent().insertBefore('#new_request.request-form label:contains("Sujet")');

    $('#new_request.request-form label:contains("Pays")').parent().insertBefore('#new_request.request-form label:contains("Description")');

    Do you know if this code is still valid or if it has to be updated ?

    Thanks for your help !

    0
  • Jessie Schutz
    Zendesk team member

    Welcome to the Community, Noémie!

    I'm definitely not a coding expert, but I'll do my best. :) A couple comments above yours Andrea, the tip author, points out that some changes have been made to Guide since she first published this, so some of the CSS element names may be different. If you haven't seen that yet, I'd definitely suggest that your first step should be to double check that everything in your code has the right name.

    If you've already done that, or if you're still stuck after you've checked it, let us know and I'll see if I can find one of our coding gurus to take a peek at it!

    0
  • Noémie Dumez

    Hello Jessie,

    Thanks for your answer. Yes, it finally worked but I have a rpoblem mentioned previously by other users in the comments. The drop down field will not display its sélections... If someone has found the solution, I am interested. Thank you !

    Noémie

    0
  • Jessie Schutz
    Zendesk team member

    Hey Noémie! Can you clarify what you mean when you say the drop down field doesn't display the selections? Maybe a screenshot would be helpful as well.

    0
  • Aren Marcoosi

    Hi Au Finh,

    I made the changes you suggested but unfortunately it did not work. Any other ideas?

    0
  • Jacob J Christensen - Cloudhuset A/S
    Community Moderator

    Hi Jennifer,

    I think Brill Wang above addressed this exact issue.

    0
  • Antonio King

    This is an incredible tip, so thanks a ton Elizabeth. For those that want to move several fields, this helped:

     

    • You need to add separate code for each different field you want to move: 


      ^ tells the form to move my custom field "Name" before "Subject" (the default top one courtesy of ZD)

    • ^ tells the form to move my custom field "Ticket category" before my other custom field, "Name". 

     

    End result 

     

     

    Also a good-to-know: if your ticket fields (custom) have punctuation in the title of the field, best to get rid of them so the JS can actually read the field name. Otherwise, it'll assume it's another coding piece being added and won't recognize the form field. 

    0
  • Jennifer Rowe
    Zendesk Documentation Team

    Hi Antonio,

    Glad to hear the tip was useful to you. And thanks for sharing the changes you made to make it work even better!

    0
  • Martin Östergren

    Hello!

    I have replaced the order of CC and Subject with this code:

    $(document).ready(function() {
      // rearrange form fields
    $('#new_request.request-form label:contains("Subject")').parent().insertBefore('#new_request.request-form label:contains("CC")');

    And it looks just fine.

    However when the form is submitted the content of Subject gets replaced with the email address in CC. So I receive a ticket with an email address as subject and there is no CC in the ticket.

    Whats going wrong?

    0
  • Antonio King

    Wondering if anyone has any insight on how to move the remaining fields? I have a few fields that I'd like to move above the main "subject" and "description" box (would like to move "change/cancel subcategories" and "Order Number" which are two conditional fields.), but I don't see the code anywhere to move those fields.

     

    0
  • Crawford Philleo

    I was able to get this work, but changing the language breaks the re-ordering of the fields. Is there a way to incorporate different languages into the js logic? I could be missing something obvious.

    Thanks!

    0

サインインしてコメントを残してください。

Powered by Zendesk