Validation on multiple Value
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
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
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi Gianni,
Try to replace 'and' operator with 'or' here:
Try to replace 'and' operator with 'or' here:
Code: Select all
if (fd.field('Lieferant_x0020_Name').value() == "") || fd.field('City').value() == ""))
-
- Information
-
Who is online
Users browsing this forum: No registered users and 15 guests