DatePicker field how to disable pasting data

CraigH 15 Apr, 2016
In chronoforms5, is there any way to not allow data to be pasted into a datepicker field. I can see that you cannot type in the field but you can paste data into it. I have some calculations that rely on a proper yyyy-mm-dd format in the field that can break if random data is pasted into the field.
CraigH 18 Apr, 2016
1 Likes
Sorry for the delay in replying, that worked great many thanks!! For the record, in case it helps others I added the following javascript to a load Javascript action in the onload just before html (render form):
jQuery(document).ready(function(){
  jQuery('#id_of_field').bind("cut copy paste", function(e) {
    e.preventDefault();
  });
});
where id_of_field is the id assigned to the field I wanted to block pasting.
This topic is locked and no more replies can be posted.