Apr 15, 2026

Portal Form - On Change of Date Picker

Its very normal to write a JS for any field on the form as below;

$("#so_name").change(function () {
  //code
});

This will not work for a field with Data Picker.

Below is the way to go.

1) Press F12 in the Form to get the code and go to Console

2) Then type $('div.control') and enter. This will produce you a div control list as below.    

3) Now find out the div tag number related to the date picker you are interested in.

4) Suppose its 9, below is the on Change even method for it.           

var dpcontrol = $('div.control')[9];
$(dpcontrol).on("dp.change", function (e) {
     let _startDate = new Date(e.date);
     // Code        
});

Hope this helps!