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

Have more questions? Submit a request

62 Comments

  • Elanor Riley
    Comment actions Permalink

    You're welcome! And yeah you're right I didn't even notice your use of .label() which isn't valid for jQuery, so that would totally explain why it wasn't working. Glad that we could help you find a solution :)

    0
  • Jamee Lewis
    Comment actions Permalink

    Hi, 

    Hoping someone can help me. We are trying to hide the subject and description on just one of our forms and have them populate with details from the form upon submission.

    However, the description on other forms is being overridden when an employee submits their requests. Below is the code we have used:

    Any help would be great!! 

     

    //Form Submit

    $(document).submit(function() {

    //only run on specific form

    if (window.location.href == "https://INSERTDOMAIN.zendesk.com/hc/en-us/requests/new?ticket_form_id=360000041815")

    {

    //set a string to equal the custom field value

    var subjectstring1 = $("#request_custom_fields_360000255215").val();

    //set subject to equal a string including field value string

    $('#request_subject').val("Employee Departure" + " - " + subjectstring1);

    }

    {

     //set a string to equal the custom field value

    var subjectstring1 = $("#request_custom_fields_360000255215").val();

    //set description to equal a string including field value string

    $('#request_description').val("Employee Departure" + " - " + subjectstring1);

    }

    });

    //End Form Submit

     

      //adding a disclaimer

     

      var selected = $('#request_issue_type_select option:selected').text();

    if (selected == "Departure Request") {

    $('div.request_ticket_form_id').append('<p></p>');

      }

      //end disclaimer

     

      //hide system fields based on ticket forms (change subdomain and form id)

     if (window.location.href == "https://INSERTDOMAIN.zendesk.com/hc/en-us/requests/new?ticket_form_id=360000041815") { 

       $('#request_subject').val('"Employee Departure" + " - " + subjectstring1');

          $('#request_description').val('"Employee Departure" + " - " + subjectstring1');

          $('#request_subject').parent('.request_subject').hide();

          $('#request_description').parent('.request_description').hide();

    }

    0

Please sign in to leave a comment.

Powered by Zendesk