Hi,
[quote=aaron_w;10792]
Can I do complex conditionals? IE, is there some way to do AND and OR in the computation?
such as
Code:
if (qty_Item1 < 1) and (qty_Item2 < 1)
{
// something
}
Yes. "and" is "&&" (which for HTML validation you may need to enter as && - we need to provide a synonym) and "or" is "||"
For example:
Code:
if ((qty_Item1 < 1) && (qty_Item2 < 1))
{
// something
}
or without the redundant parentheses:
Code:
if (qty_Item1 < 1 && qty_Item2 < 1)
{
// something
}
And here's a more complex one:
Code:
if ((item1_name == '' || qty_Item1 < 1) && (item2_name == '' || qty_Item2 < 1))
{
FMUserError('please select at least one item');
}
Also, can comparisons be inverted? Can I use != or !< or something?
Yes, here are the supported operators:
Code:
== equals
!= not equals
> greater than
>= greater than or equal
< less than
<= less than or equal
Note that the opposite of < is >=, the opposite of > is <=.
When I use the FMUserError() function to throw an error from the module, it shows the error message to the User. But, it doesn't seem to tell me the error message in the alert email it sends me.
All I seem to get is:
Code:
The following error occurred in FormMail :
fmcompute_usererrors
Error=One or more errors occurred in your form submission
Is that by design or am I possibly doing something wrong here?
It's implemented to only show the "headline" error in the alert, not all the details.
That could certainly be changed in a future version.
Bookmarks