What is wrong with following event ajax call ffrom form on chanhe od date field

What is wrong with following event ajax call ffrom form on chanhe od date field ?

window.FormAPI.evaluateServerSideExpression(function(fn){
          window.FormAPI.setValue("number41",fn);
},"=calworkdays(FormAPI.getValue("date1").id, FormAPI.getValue("date2").id])");

OriginalPostID-23033

OriginalPostID-23033

  Discussion posts and replies are publicly visible

Parents
  • One last thing to point out. The change event of a date is triggered until the second time a user picks a date. The change from blank to a new date is not considered a change in the date, therefore, the change event won't be triggered. In order to workaround the issue you can call the change event on the load event of the form for "date2":

    var dateID = 'date2';
    $('#date_date_' + dateID + '_valueDateSingle_fd_component_' + window.FormDesigner.runtimeNamespace + dateID +'_').trigger('change');

    This will allow the user to get the desired result in "number41", after fixing the syntax error I mentioned in my previous post, with a single click on a date from the date picker.
Reply
  • One last thing to point out. The change event of a date is triggered until the second time a user picks a date. The change from blank to a new date is not considered a change in the date, therefore, the change event won't be triggered. In order to workaround the issue you can call the change event on the load event of the form for "date2":

    var dateID = 'date2';
    $('#date_date_' + dateID + '_valueDateSingle_fd_component_' + window.FormDesigner.runtimeNamespace + dateID +'_').trigger('change');

    This will allow the user to get the desired result in "number41", after fixing the syntax error I mentioned in my previous post, with a single click on a date from the date picker.
Children
No Data