Request Checkbox on submit

3 Comments

  • Tipene Hughes
    Zendesk Developer Support Team

    Hi @...,

    Thanks for reaching out!

    You can use the ticket object to access the value of the checkbox, so something like this could work:

    client
    .get("ticket.customField:custom_field_1260825969349")
    .then(data => console.log(data));

    This will return a string of ‘yes’ or ‘no’ depending on if the checkbox has been checked or not.

    Here’s a link to the relevant docs:

    https://developer.zendesk.com/api-reference/apps/apps-support-api/ticket_sidebar/#ticketcustomfieldfieldname

    Alternatively, you can also set the custom field to ‘required’ in your Zendesk instance UI. Here’s some information on how to do that:

    https://support.zendesk.com/hc/en-us/articles/203661496-Adding-custom-fields-to-your-tickets-and-support-request-form

    I hope this helps! If you have any questions, feel free to reach out.

    Tipene

    0
  • Patrick Bernardi

    I am programming this in the script.js file, this code will work in there?

    see sample below of what i presently do

     

    function checkitsupportrequiredfields() {
    var strITTopicReq = $('#request_custom_fields_1260812850530').val();
    var strITDescriptionReq = $('#request_custom_fields_1260812850510').val();
    var strITDescriptionReqLength = $('#request_custom_fields_1260812850510').val().length;
    if (strITTopicReq != "" && strITDescriptionReqLength > 3) {
    $(':input[type="submit"]').prop('disabled', false);
    $('#request_description').val(strITDescriptionReq);
    } else {
    $(':input[type="submit"]').prop('disabled', true);
    $('#request_description').val(strITDescriptionReq);
    }
    }

    0
  • Tipene Hughes
    Zendesk Developer Support Team

    Hi @...,

    Yes, there shouldn't be any problem using the method I mentioned above in your code. If you'd like to send me the relevant files though, I can double-check that for you. Just be sure to redact any sensitive information.

    Thanks!

    Tipene

    0

Please sign in to leave a comment.

Powered by Zendesk