Support » Plugin: Calculated Fields Form » Displaying Text based on a calculation

  • Resolved David Kirwan

    (@killerfm)


    Hi there,

    I’m looking to display text dependent on the value of a calculated field. For example if a calculated field is below 0 I want some text to be displayed and if the field is over 0 I want some different text to be displayed. I have viewed the other support tickets and I know that you can’t use text in a calculated equation.

    Is there any other way?

    Thanks for your help.

    http://wordpress.org/plugins/calculated-fields-form/

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

    (@codepeople)

    Hi,

    To accept texts as valid results of equations, will be required modify the fbuilder-pro.jquery.js file.

    You should go to the snippet of code:

    return (isFinite(r) || /\d{1,2}\/\d{1,2}\/\d{4}/.test(r)) ? r : false;

    and set the possible results in the conditional operator. For example, suppose that you want to accept the text “hello world”, then the previous code should be modified like below:

    return (isFinite(r) || /\d{1,2}\/\d{1,2}\/\d{4}/.test(r) || /hello world/.test(r)) ? r : false;

    That’s perfect. Thanks so much.

    You really helped me out. Your plugin is AWESOME!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying Text based on a calculation’ is closed to new replies.