Validation on multiple Value

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
gianni972
Posts: 7
Joined: Wed May 18, 2016

19 May 2016

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

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

20 May 2016

Hi Gianni,

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

Code: Select all

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

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests