• Resolved Sportuojantys

    (@needfeed)


    Hello, I’m old CFF user, but I have question like newbie ??
    I’m trying to create personality type calculator and it has 4 different selections and I want that in the result would be only text, about 1 sentence about every selection (there are 4 different selections).
    Now I see only the fieldname7 text in the results, how to add fieldname8, fieldname3 and fieldname6 text?

    The code:

    fieldname8==’M?lyna’?’Esate ?altas, i?tvermingas ir kiek grubesnio charakterio’:(fieldname8==’Pilka’?’Esate ramaus būdo ir gan?tinai i?tvermingas’:(fieldname8==’Ruda’?’PARA?YK RUDAAAAA’:(fieldname8==’?alia’?’PARA?YK ?ALIAAAAAA’:’RA?YK SKIRTINGOS AKYS’)));

    fieldname3==’?viesi’?’?VIESūS RA?YK’:(fieldname6==’Tamsi’?’TAMSUS RA?YK’:’RAUDONII RA?Yk’);

    fieldname6==’Trumpi’?’TRUMPI RA?YK’:(fieldname6==’Vidutinio ilgio’?’VIDUTINIAI RA?YK’:’ILGI RA?YK’);

    fieldname7==’Stori’?’STORI RA?YK’:(fieldname7==’Vidutinio storio’?’VIDUTINIAI RA?YK’:’PLONI RA?YK’);`

    And 2nd question is it possible that user enters his email in the CFF (I think it’s field “email”) and we got it saved inside WP?

    Thanks in advance ??

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

    (@codepeople)

    Hello @needfeed

    You can use the CONCATENTATE operation as follows:

    CONCATENTATE(
    (fieldname8=='M?lyna' ? 'Esate ?altas, i?tvermingas ir kiek grubesnio charakterio' : (fieldname8=='Pilka' ? 'Esate ramaus būdo ir gan?tinai i?tvermingas' : (fieldname8=='Ruda' ? 'PARA?YK RUDAAAAA':(fieldname8=='?alia' ? 'PARA?YK ?ALIAAAAAA' : 'RA?YK SKIRTINGOS AKYS')))), 
    ' ',
    (fieldname3=='?viesi' ? '?VIESūS RA?YK' : (fieldname6=='Tamsi' ? 'TAMSUS RA?YK' : 'RAUDONII RA?Yk')),
    ' ',
    (fieldname6=='Trumpi' ? 'TRUMPI RA?YK' : (fieldname6=='Vidutinio ilgio' ? 'VIDUTINIAI RA?YK' : 'ILGI RA?YK')),
    ' ',
    (fieldname7=='Stori' ? 'STORI RA?YK' : (fieldname7=='Vidutinio storio' ? 'VIDUTINIAI RA?YK' : 'PLONI RA?YK'))
    );

    But please, note that the resulting text could be longer than the input box of the calculated field.

    In this case, you can use the calculated field as an auxiliary but display the result in another field.

    In this case, you can insert an “HTML Content” field with a div tag in its content to display the result:

    <div class="result-here"></div>

    And edit the equation as follows:

    
    (function(){
    var result = CONCATENTATE(
    (fieldname8=='M?lyna' ? 'Esate ?altas, i?tvermingas ir kiek grubesnio charakterio' : (fieldname8=='Pilka' ? 'Esate ramaus būdo ir gan?tinai i?tvermingas' : (fieldname8=='Ruda' ? 'PARA?YK RUDAAAAA':(fieldname8=='?alia' ? 'PARA?YK ?ALIAAAAAA' : 'RA?YK SKIRTINGOS AKYS')))), 
    ' ',
    (fieldname3=='?viesi' ? '?VIESūS RA?YK' : (fieldname6=='Tamsi' ? 'TAMSUS RA?YK' : 'RAUDONII RA?Yk')),
    ' ',
    (fieldname6=='Trumpi' ? 'TRUMPI RA?YK' : (fieldname6=='Vidutinio ilgio' ? 'VIDUTINIAI RA?YK' : 'ILGI RA?YK')),
    ' ',
    (fieldname7=='Stori' ? 'STORI RA?YK' : (fieldname7=='Vidutinio storio' ? 'VIDUTINIAI RA?YK' : 'PLONI RA?YK'))
    );
    
    jQuery('.result-here').html(result);
    return result;
    })()
    

    And finally, you can hide the calculated field by ticking a checkbox in its settings.

    Best regards.

    Thread Starter Sportuojantys

    (@needfeed)

    Hello, this function is working (but answer box only shows last element):

    (fieldname8=='M?lyna'?'Esate ?altas, i?tvermingas ir kiek grubesnio charakterio':(fieldname8=='Pilka'?'Esate ramaus būdo ir gan?tinai i?tvermingas':(fieldname8=='Ruda'?'PARA?YK RUDAAAAA':(fieldname8=='?alia'?'PARA?YK ?ALIAAAAAA':'RA?YK SKIRTINGOS AKYS')))),
    ' ',
    (fieldname3=='?viesi'?'RA?YK ?VIESI':(fieldname3=='Tamsi'?'RA?YK TAMSII':'RA?YK RAUDOOONNA')),
    ' ',
    (fieldname6=='Trumpi'?'RA?YK TRUMPIIII':(fieldname6=='Vidutinio ilgio'?'RA?YK VIDUTINIO ILGIOOO':'RA?YK ILGIIII')),
    ' ',
    (fieldname7=='Stori'?'RA?YK STORIII':(fieldname7=='Vidutinio storio'?'RA?YK VIDUTINIO STORIO':'RA?YK PLONIIII'));

    Then I tried firstly the CONCATENTATE operation, so added only “CONCATENTATE(” and “);” and it didn’t work, maybe because there was not enough space in the answer box?:
    CONCATENTATE(
    (fieldname8==’M?lyna’?’Esate ?altas, i?tvermingas ir kiek grubesnio charakterio’:(fieldname8==’Pilka’?’Esate ramaus būdo ir gan?tinai i?tvermingas’:(fieldname8==’Ruda’?’PARA?YK RUDAAAAA’:(fieldname8==’?alia’?’PARA?YK ?ALIAAAAAA’:’RA?YK SKIRTINGOS AKYS’)))),
    ‘ ‘,
    (fieldname3==’?viesi’?’RA?YK ?VIESI’:(fieldname3==’Tamsi’?’RA?YK TAMSII’:’RA?YK RAUDOOONNA’)),
    ‘ ‘,
    (fieldname6==’Trumpi’?’RA?YK TRUMPIIII’:(fieldname6==’Vidutinio ilgio’?’RA?YK VIDUTINIO ILGIOOO’:’RA?YK ILGIIII’)),
    ‘ ‘,
    (fieldname7==’Stori’?’RA?YK STORIII’:(fieldname7==’Vidutinio storio’?’RA?YK VIDUTINIO STORIO’:’RA?YK PLONIIII’))
    );

    Then I tried adding HTML content field, with formula you said: <div class=”result-here”></div>; (this box is not visible in the calculator after i push the button) and the equation:
    (function(){
    var result = CONCATENTATE(
    (fieldname8==’M?lyna’ ? ‘Esate ?altas, i?tvermingas ir kiek grubesnio charakterio’ : (fieldname8==’Pilka’ ? ‘Esate ramaus būdo ir gan?tinai i?tvermingas’ : (fieldname8==’Ruda’ ? ‘PARA?YK RUDAAAAA’:(fieldname8==’?alia’ ? ‘PARA?YK ?ALIAAAAAA’ : ‘RA?YK SKIRTINGOS AKYS’)))),
    ‘ ‘,
    (fieldname3==’?viesi’ ? ‘?VIESūS RA?YK’ : (fieldname3==’Tamsi’ ? ‘TAMSUS RA?YK’ : ‘RAUDONII RA?Yk’)),
    ‘ ‘,
    (fieldname6==’Trumpi’ ? ‘TRUMPI RA?YK’ : (fieldname6==’Vidutinio ilgio’ ? ‘VIDUTINIAI RA?YK’ : ‘ILGI RA?YK’)),
    ‘ ‘,
    (fieldname7==’Stori’ ? ‘STORI RA?YK’ : (fieldname7==’Vidutinio storio’ ? ‘VIDUTINIAI RA?YK’ : ‘PLONI RA?YK’))
    );

    jQuery(‘.result-here’).html(result);
    return result;
    })()

    As I see, it should be working but it’s not, I attached some pictures, maybe the problem is in other place?

    https://ibb.co/7k5LW5V
    https://ibb.co/0XPw6Qm
    https://ibb.co/znZdVmb
    https://ibb.co/THpLhFs

    Plugin Author codepeople

    (@codepeople)

    Hello @needfeed

    I’m sorry, but it is hard to identify the cause of the issue only by checking some screenshots. I need to check the equations in action.

    Best regards.

    Thread Starter Sportuojantys

    (@needfeed)

    I think I found problem, it’s CONCATENATE, not CONCATENTATE ??

    Plugin Author codepeople

    (@codepeople)

    Hello @needfeed

    My apologies, yes, that is a typo.

    Best regards.

    Thread Starter Sportuojantys

    (@needfeed)

    All good, thank you for the help codepeople ??

    Thread Starter Sportuojantys

    (@needfeed)

    BTW, can you answer this one?
    “And 2nd question is it possible that user enters his email in the CFF (I think it’s field “email”) and we got it saved inside WP?”

    Plugin Author codepeople

    (@codepeople)

    Hello @needfeed

    These are features included with the commercial distributions of the plugin, but we can’t reply about that in this forum. We are not allowed to support any customers in these forums.

    For pro or commercial product support please contact us directly on our site. This includes any pre-sales topics as well.

    Commercial products are not supported in these forums. We will happily answer this and any other questions you can have on our own site.

    Thank you.

    Thread Starter Sportuojantys

    (@needfeed)

    Understood, thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Add text row in the results’ is closed to new replies.