Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    The calculated field is waiting for a number as result of equation, but “HIGH” is a text. So, if you want that “HIGH” text be a valid value, you should follow the steps below:

    – Open the module_public.js file, located in “/wp-content/plugins/calculated-fields-form/js/modules/01_mathematical_logical/public/module_public.js”, with the text editor your choice.

    – Go to the snippet of code:

    return isFinite( v ) || /\d{2}[\/\-\.]\d{2}[\/\-\.]\d{4}/.test( v );

    and modify it like follow:

    return isFinite( v ) || /\d{2}[\/\-\.]\d{2}[\/\-\.]\d{4}/.test( v ) || /HIGH/i.test( v );

    That’s all.
    Best regards.

    Thread Starter tcumpston

    (@tcumpston)

    Worked like a charm. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘If Statement Returning Text’ is closed to new replies.