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

Return to top

39 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
    Zendesk Community Manager
    Thanks Sam!
    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
  • 이지훈

    I realized there was a critical problem with this method.

    If the end user accidentally clicks the submit button without filling in the required fields(*) in the ticket form that hides the title and description using .hide(), the title and description are exposed on the redirected page. This opens a hole for end users to change their titles and descriptions.

    Has anyone confirmed this or solved it?

     

    0
  • brandon tidd
    Community Moderator
    The Humblident Award - 2021

    Thanks for reaching out!  You could try using JavaScript to confirm required fields before submitting:

    for (const el of document.getElementById('form').querySelectorAll("[required]")) {
      if (!el.reportValidity()) {
        return;
      }
    }
    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. 

    Example of code we use:

    if(ticketForm == 4418185168269) {
    $('.form-field.request_subject').hide(); // Hide subject
    $('.form-field.request_description').hide(); // Hide description
    $('#request_subject').val('subject text here'); // autofill subject
    $('#request_description').val('description text here.'); // autofill description
    }

    Example of URL with pre-filled element. I've tried the URL with and without subject/description. 

    https://mycompany.zendesk.com/hc/en-us/requests/new?ticket_form_id=4418185168269&tf_anonymous_requester_email=test@mycompany.com

    Anyone have any ideas why this type of URL may break the function that hides subject/description or what I could do about it to get both working? 

    0

Please sign in to leave a comment.

Powered by Zendesk