Disabling the subject and description fields on the new request form in Help Center Follow

Comments

5 comments

  • Avatar
    Gabriel Scott

    Can you hide the subject/description for only one form, if you have multiples?

  • Avatar
    Dipesh Dave

    Hey Gabriel,

    Unfortunately when you hide the subject/description for one form, it will hide the subject/description for all forms.

    - However as a workaround you could include custom ticket fields on these forms and name them separately from the system fields, so that way you can hide the subject/description field (which is a system field), but you can still display individual custom fields that you have added to the form.

    - For example you could name the custom field "Details of Issue" or "Topic" for the subject.

    Please feel free to reach out to us at Support@Zendesk.com in case you have further questions for the mentioned workaround!

  • Avatar
    Daniel Cooper

     

    If you wrap the code about in an If statement you can do this. 

    If(ticketForm == 123456) {

    Add code here

    }

    Replace 123456 with the ticket form ID which can be found at the end of the URL on the ticket form edit screen.  

  • Avatar
    LodiseSam (Edited )

    Do I need quotes around the ticketForm variable?  Without quotes, the if statement breaks all of my forms completely.  As in no fields at all.

    Second, the code works without the if statement, but does nothing with the if statement.  Can you take a look below and see if I am doing something wrong?  Maybe its not the exact correct variable id.  The url has "ticket_form_id=215063".  But i tried that too and same result.

    Code I am using:

    if ('ticketForm' == 215063) {
    $('.form-field.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
    }

     

    Edit: In case any one else runs into this. The changes just weren't showing up in the preview.  Once i published it, it worked perfectly.  Code i went with is below:

    var ticketForm = location.search.split('ticket_form_id=')[1];

    if(ticketForm == 215063) {
    $('.form-field.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
    }

     

  • Avatar
    Jessie Schutz

    Thanks for coming back to share your solution, Sam!

Please sign in to leave a comment.

Powered by Zendesk