Number field validation not accepting 0

Hi

we where validating a number field to check if there is any value in this field.

if (!fd.field('Fee').value) {
this.error = "Please enter the Total VO Fee.";
return false;
}

but when 0 in the field it still shows a validation error.

how to we get over this?

Hello @Rinu,

The 0 value is treated as blank. Please use this condition instead:

 if(fd.field('Fee').value >= 0)
1 Like

HI Mnikitina,

i am getting the below error
if (fd.field('BidA').value >= 0) {
this.error = "Contract type is Sub-Consultant Bid A is needed.";
return false;
}
image

image

Hello @Rinu,

I'm sorry, you need to use a different sign:

 if (fd.field('BidA').value <= 0) {
this.error = "Contract type is Sub-Consultant Bid A is needed.";
return false;
}