Title: Error handling
Last modified: July 12, 2022

---

# Error handling

 *  Resolved [hheyhey568](https://wordpress.org/support/users/hheyhey568/)
 * (@hheyhey568)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/error-handling-4/)
 * Hello team,
    Is there a way to handle the error? In my calculation , sometimes
   if the user gives wrong input , the calculation returns either blank or NaN.
 * When this happens , I would like to inform user that there is error in any of
   the input and to check the inputs.
 * For example : Calculated fieldname10 becomes NaN or blank due to wrong input 
   in fieldname1. So I want to inform user at fieldname1 to check input. Also at
   fieldname10, I don’t want to see NaN but warning message to check input.
 * Regards,

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/error-handling-4/#post-15816715)
 * Hello [@hheyhey568](https://wordpress.org/support/users/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.
 *  Thread Starter [hheyhey568](https://wordpress.org/support/users/hheyhey568/)
 * (@hheyhey568)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/error-handling-4/#post-15820083)
 * 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,
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/error-handling-4/#post-15820090)
 * Hello [@hheyhey568](https://wordpress.org/support/users/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.
 *  Thread Starter [hheyhey568](https://wordpress.org/support/users/hheyhey568/)
 * (@hheyhey568)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/error-handling-4/#post-15831741)
 * Hello Team ,
    Thanks for the help.
 * Can I make this instruct field with different colour like red that user can be
   warned?
 * regards,
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/error-handling-4/#post-15831972)
 * Hello [@hheyhey568](https://wordpress.org/support/users/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](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/2020/01/12/form-design)
 * [https://cff.dwbooster.com/blog/2021/09/27/create-new-form-template](https://cff.dwbooster.com/blog/2021/09/27/create-new-form-template)
 * Best regards.
 *  Thread Starter [hheyhey568](https://wordpress.org/support/users/hheyhey568/)
 * (@hheyhey568)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/error-handling-4/#post-15832010)
 * Thanks a lot

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Error handling’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [hheyhey568](https://wordpress.org/support/users/hheyhey568/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/error-handling-4/#post-15832010)
 * Status: resolved