How to set field format based on the field Name
Hi All,
I am trying to automate the fillable field formating based on the field name, is it possible to set the field format based on the field format, I tried below script however it seems nothing changed and not showing any error. However if i am not using the arr and use one field name it works.
Any help much appreciated.
var arr = ['clm_bdate','di_date','ee_end_date_occ','ee_start_date_occ','ft_date','pt_date',' bdate_youngest', 'injury_date'];//date field names
for (var i = 0; i < this.numFields; i++) {
var A = this.getField(this.getNthFieldName(i));
if (arr.indexOf(A) >= 0) {
var cFormat = "mm/dd/yyyy";
A.setAction("Format", "AFDate_FormatEx(\""+cFormat+"\")");
A.setAction("Keystroke", "AFDate_KeystrokeEx(\""+cFormat+"\")");
}
}
this.getField("A").userName="Enter the Date in MM/DD/YYYY Format";
