Recent searches


No recent searches

Unable to add event listener on DatePicker in Forms



Posted Nov 15, 2023

Hello,

One issue I have encountered since I have been working with custom javascript and jquery in Forms is that the datepicker (Date field) does not trigger any events that I pass to it.  Other input fields can trigger events like "keyup", "change", etc. but the datepicker does not.

For example the following code will not execute:

let datDepartDate = document.getElementById('request_custom_fields_1260825973750');
datDepartDate.addEventListener("change", someFunction);

where "request_custom_fields_1260825973750" is a Date field.

Input fields work fine but not the Date field.  Why is that?

 


0

3

3 comments

image avatar

Dan R.

Zendesk LuminaryCommunity Moderator

Hey Mark, is this something you're trying to build in a Zendesk App or a customization you're trying to make to the ticket forms in Guide?

Depending which, it might be better suited in a different part of the community to get the best eyes on it. Let me know and I'll try to help you find the best spot for this post!

0


A customization to the ticket forms in Guide

0


image avatar

Dan R.

Zendesk LuminaryCommunity Moderator

Thanks, I've moved this to the Guide Feedback community. Thanks for posting!

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post