Hi,
I'm customizing "submit a request" page to disable "submit" button if subject and description are empty. I added some code to the subject input box to check content in both fields (subject and description) and if there is, enable "submit". This works fine.
When I add some code to "description", it doesn't work... the on change event for the textarea is never fired. Example:
var requestCommentTextarea = document.querySelector('.request_description textarea');requestCommentTextarea.addEventListener('change', function (event) {console.log(event.target.value);});
var requestCommentTextarea = document.querySelector('.request_description textarea');
var usesWysiwyg = requestCommentTextarea && requestCommentTextarea.dataset.helper === "wysiwyg";function isEmptyPlaintext(s) {
return s.trim() === '';
}function isEmptyHtml(xml) {
var doc = new DOMParser().parseFromString(`<_>${xml}</_>`, "text/xml");
var img = doc.querySelector("img");
return img === null && isEmptyPlaintext(doc.children[0].textContent);
}var isEmpty = usesWysiwyg ? isEmptyHtml : isEmptyPlaintext;
if (requestCommentTextarea) {
requestCommentTextarea.addEventListener('input', function () {
console.log("event");
if (isEmpty(requestCommentTextarea.value)) {
requestSubmitButton.disabled = true;
} else {
requestSubmitButton.disabled = false;
}
});
}

Good question. I have tested native integration with a checkbox ticket field.
For example, it looks like I couldn't "Submit" button untill some mandatory fields be blank:
However, in reality checkbox fields only, is optional. More information about it here.
It means that you can submit your request without Checkbox activation.
As a solution we can recommend creation of custom code via Building a custom ticket form with the Zendesk API.
Please accept our apologies for some limitations with that.
Thanks