Hello @hheyhey568
You can use an if conditional statement or IF operation in the equation to check the fieldname1 value.
For example, assuming you have implemented the equation fieldname2/fieldname1. In mathematics, the division by zero generates an error. So, you can check the fieldname1 value:
IF(fieldname1, fieldname2/fieldname1, '')
Or you can check the result:
(function(){
var result = fieldname2/fieldname1;
return IF(NOT(isNaN(result)), result, '');
})()
Best regards.
Thanks a lot.
Can we give warning message on below the fieldname1 to user that “ check the input value” so that user enter the correct value ?
Pls help
Regards,
Hello @hheyhey568
Yes, of course. You can control everything.
For example, you can insert an “Instruct. Text” field with the information you want. Assuming the field’s name is fieldname123.
And then, edit the equation as follows:
(function(){
var result = fieldname2/fieldname1;
if(NOT(isNaN(result)))
{
IGNOREFIELD(123);
return result;
}
else
{
ACTIVATEFIELD(123);
return '';
}
})()
Note that you should replace 123 with the numeric component in the name of your “Instruct. Text” field.
Best regards.
Hello Team ,
Thanks for the help.
Can I make this instruct field with different colour like red that user can be warned?
regards,
Hello @hheyhey568
Yes, that’s possible. Please, follow the steps below:
1. Assign a custom class name to the “Instruct” field. For example, error-cls
You assign class names to the fields through their attributes “Add CSS Layout Keywords”.
2. Define the new class through the “Customize Form Design” attribute in the “Form Settings” tab (https://resources.developers4web.com/cff/images/documentation/form-settings-tab.png):
#fbuilder .error-cls *{color:red !important;}
More information about customizing the forms designs by reading the following posts in the plugin’s blog:
https://cff.dwbooster.com/blog/2020/01/12/form-design
https://cff.dwbooster.com/blog/2021/09/27/create-new-form-template
Best regards.