Dear @DryChips,
It seems there is no value - either you're using the wrong field name or the field's value is empty. I don't know what code you're using and whether the value is required or not, but if it's not, you can always first check if there's a value at all:
if (value && (value.length < 11 || value.length > 20)){
Using this code:
Field name is correct.
//This code will validate the New Phone Number field - [Personal Details]
fd.field("Emergency_Phone1").validators.push({
name:"",
error:"",
validate: function (value){
if (fd.field('Question_2').value.includes('Emergency Contact Details')>=0){
if (value.length < 11 || value.length > 20){
this.error = "Please enter a minimum of 11 digits";
return false;
}
return true;
}
return true;
}
});
Dear @DryChips,
I've shown you the code above, you can just add it here:
//This code will validate the New Phone Number field - [Personal Details]
fd.field("Emergency_Phone1").validators.push({
name:"",
error:"",
validate: function (value){
if (fd.field('Question_2').value.includes('Emergency Contact Details')>=0){
if (value && (value.length < 11 || value.length > 20)){
this.error = "Please enter a minimum of 11 digits";
return false;
}
return true;
}
return true;
}
});