WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. killerfm
    Member
    Posted 1 year 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.

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

  2. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    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;

  3. killerfm
    Member
    Posted 1 year 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

About this Topic