Validation on multiple Value

rss

Posted by gianni972 - May 19 ’16 at 08:08

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

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 3 months 29 days
    #1 by Dmitry Kozlov May 20 ’16 at 03:29

    Hi Gianni,

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

    if (fd.field('Lieferant_x0020_Name').value() == "") || fd.field('City').value() == ""))
    
Displaying 1 to 1 of 1 messages