Calculated Fields Form
[resolved] concatenate in calculated field (2 posts)

  1. fitlicious
    Posted 1 year ago #

    Sorry. Another newbie question.

    Can you concatenate text with a calculated field? If so, how?


  2. codepeople
    Plugin Author

    Posted 1 year ago #


    The calculated fields are used to display numeric values, resulting of mathematical equations , furthermore the plugin tries to extract the numbers from the values of fields used in the equations.

    If you want use the calculated fields to concatenate texts, you should change a little the plugin code.

    First, if your equation is fieldname1+fieldname2, I recommend modify it like follow: fieldname1+''+fieldname2 to be sure the values of fieldname1 and fieldname2 are treated as texts.

    Second, opens 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, and modifies the snippet of code:

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

    like follow:

    return (typeof v != 'undefined');

    Best regards.

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


No tags yet.