Page 1 of 1

Validation on multiple Value

Posted: 19 May 2016
by gianni972
Hello Im sorry to ask this question because this has nothing to do with your app but I m facing a little problem.

I created a button with a validation on one field :

if (fd.field('Lieferant_x0020_Name').value() == "")

{
alert('Please, Enter all values');
return false;
}
return true;

It is working good but when i try with multiple fields, like that:

if (fd.field('Lieferant_x0020_Name').value() == "") && fd.field('City').value() == ""))

{
alert('Please, Enter all values');
return false;
}
return true;

It is not, can you tell me where im wrong please ?

Regards

Gianni

Re: Validation on multiple Value

Posted: 20 May 2016
by Dmitry Kozlov
Hi Gianni,

Try to replace 'and' operator with 'or' here:

Code: Select all

if (fd.field('Lieferant_x0020_Name').value() == "") || fd.field('City').value() == ""))