Calculated Fields Form
[resolved] Displaying Text based on a calculation (3 posts)

  1. David Kirwan
    Posted 2 years ago #

    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.


  2. codepeople
    Plugin Author

    Posted 2 years ago #


    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;

  3. David Kirwan
    Posted 2 years ago #

    That's perfect. Thanks so much.

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Calculated Fields Form
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic