WordPress.org

Ready to get started?Download WordPress

Forums

Calculated Fields Form
[resolved] Values in Dropdown/Checkboxes fields (10 posts)

  1. rey.abc
    Member
    Posted 1 year ago #

    Hello again, im confused about how these work when they have more than 2 variables. For example, when i have only 1 variable its plain easy since i can just use (fieldname3=='cat'?250:500) meaning that cat=250 and the 2nd variable=500.

    But if i have 3 variable lets say, i cant do (fieldname3=='cat'?250:500:1000) [meaning that the 3rd variable i added equals 1000]. I cant do this because the formula wont work.

    Now... after checking the "calculation with dates" example that the plugin has, i realized that i can easily give each dropdown/checkbox variable a value by just putting the # of the value next to the name at the fields, to make it more easy to understand this is what i mean: http://puu.sh/2Fjny.png

    But my problem is i dont want the numbers to appear in the calculator, and they do appear if i do it the way "calculation with dates" do it.

    So is there a way i can do it without the numbers showing? Maybe someway to "nest" the first formula i was trying (i tried to nest it, didnt work the multiple ways i tried). By first formula i refer to this: (fieldname3=='cat'?250:500)

    Thank you very much!

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

  2. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    We are working in a new plugin version that allow separate the values of checkboxes and drop-down menues from its texts.

    A workaround in the current version is to hide the numbers in the field's text with a tag <span>, like follow:

    Parking <span style="display:none;">10</span>
    Breakfast <span style="display:none;">20</span>
    Premium Internet Access <span style="display:none;">3</span>

  3. rey.abc
    Member
    Posted 1 year ago #

    Thank you very much for the quick reply.

    I only have 1 doubt now, where should i add that? I tried adding it at the field settings next to the option: http://puu.sh/2Fzk1.png but it did not work as you can see here: http://puu.sh/2FzlC.png

    I suppose im adding it where im not supposed to.

  4. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Could you send me a link to the webpage for checking the issue, please?

    If you prefer, send me the link through the contact page in my website.

    Best regards.

  5. rey.abc
    Member
    Posted 1 year ago #

    Hey, sorry for the late reply. My site happens to be new (i started uploading it yesterday, i have most of my articles in word still).
    I will send you a link to the webpage where a formula is showing, in that formula i tried the "<span>" trick but did not work, have a look at it when you can please :).

    Also i read the next version is coming up by the end of may, and that i will be able to hide fields values with it (pretty awesome!). Im very glad you guys are working on it.

    I will send you the webpage throught contact in your site.

  6. rey.abc
    Member
    Posted 1 year ago #

    Just came back to say that i did got support by mail as CodePeople asked me to. These guys (ALL of them) even happen to talk spanish (my main language), sweet!

    Incase someone else has the same problem as i was having, this is the fix: in the next update they will add an option to hide value of a field, but for now you can use this trick on radiobuttons and checkboxes <span style="display:none;">VALUE-YOU-WANT-TO-GIVE-TO-THE-FIELD</span>.

    Ex: Dog <span style="display:none;">1.55</span>
    The field dog has a value of 1.55 and it (the value) wont show up on the frontend (what the user see).

    PD: This trick wont work with dropdowns, so i'd recommend using radiobuttons for now, and when the next update comes then change it to dropdown if you desire to.

    Thanks for all the support, im very pleased and already rated this plugin today (after trying it out for about a week and getting lot of support :)) Keep it up people!

  7. Jaer1823
    Member
    Posted 3 months ago #

    I would like to know how i can select some options from 2 fields to show a third one field
    using logical conditional

    for example

    field1:
    a
    b
    c

    field2:
    d
    e
    f

    so field 3 is the comb ination of field1(a) and field2(b)

  8. Jaer1823
    Member
    Posted 3 months ago #

    I would like to know how i can select some options from 2 fields to show a third one field
    using logical conditional

    for example

    field1:
    a
    b
    c

    field2:
    d
    e
    f

    so field 3 is the comb ination of field1(a) and field2(d)

  9. codepeople
    Member
    Plugin Author

    Posted 3 months ago #

    Hi,

    If you want display a field depending of values in another two fields, you can't use the dependencies like with only one field.

    For this demo, I will suppose you have four fields: fieldname1 and fieldname2, drop down menu, fieldname3 another control, any of them, and finally the fieldname4, a calculated field. And you want display the fieldname3 if the option selected in the fieldname1 has value 1, and the option selected in the fieldname2 has the value 3.

    For this case follow the steps below:

    1. Assign to the fieldname3 a classname through the "Add Css Layout Keywords" attribute, for example myclass

    2. Paste the following class definition in any of CSS files in your website

    .myclass{display:none;}

    3. And defines the equation associated to the fieldname4 like:

    (function(){
    if( fieldname1 == 1 && fieldname2 == 3)
    {
    jQuery( '.myclass' ).show();
    }
    else
    {
    jQuery( '.myclass' ).hide();
    }

    // The rest of the equation here

    })()

    You only should use the same principles of previous demo to your form.

    Best regards.

  10. Jaer1823
    Member
    Posted 3 months ago #

    Thanks a lot the plugin work as charm with the code you gave me. It is a very profesional atention, and fast reply you save My job.

    Best regards,
    Jorge

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic