WordPress.org

Ready to get started?Download WordPress

Forums

Calculated Fields Form
[resolved] calculated field fromula in form with multiple denpendencies (6 posts)

  1. ruicampos
    Member
    Posted 8 months ago #

    The FINAL result of my form should be a estimated price for litle projects

    But I am not able to simply show the price per square meter of the material chosen by the User, this must be due to this choice to be made across multiple options with dependencies therebetween. I know this because codepeople (author of the plugin) kindly help me before, told me that forms containing multiple options requires more complex equations.

    Can you help me with the equation (funtion)to put the calculated field to show the price per square meter?

    I made a diagram to explain what I did and what I need to happen, see it here

    I will need to buy the Professional Version, but wanted to know sure I can do what I need with this plugin before spending money.

    sorry for my poor english.

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

  2. codepeople
    Member
    Plugin Author

    Posted 8 months ago #

    Hi,

    Your form is each time more complex ;-)

    Ok, so go on:

    I don't know the exact values of each fields, so you should adjust the equation to your form fields values:

    (function(){
    switch(fieldname3){
    case "paper":
    switch(fieldname4){
    case "paper1": return fieldname8;
    case "paper2": return fieldname11;
    case "paper3": return fieldname12;
    case "paper4": return fieldname13;
    }
    break;
    case "plastic":
    switch(fieldname6){
    case "plastic1": return fieldname15;
    case "plastic2": return fieldname16;
    case "plastic3": return fieldname17;
    case "plastic4": return fieldname18;
    }
    break;
    case "fabric":
    switch(fieldname14){
    case "fabric1": return fieldname19;
    case "fabric2": return fieldname21;
    case "fabric3": return fieldname22;
    case "fabric4": return fieldname23;
    }
    break;
    case "wood":
    switch(fieldname7){
    case "fabric1": return fieldname24;
    case "fabric2": return fieldname25;
    case "fabric3": return fieldname26;
    case "fabric4": return fieldname27;
    }
    break;
    }
    })()

  3. ruicampos
    Member
    Posted 8 months ago #

    hi, thank you so much for your help.

    I put this formula:

    (function(){
    switch(fieldname3){
    case "paper":
    switch(fieldname4){
    case "paper1": return fieldname8;
    case "paper2": return fieldname11;
    case "paper3": return fieldname12;
    case "paper4": return fieldname13;
    }
    break;
    case "plastic":
    switch(fieldname6){
    case "plastic1": return fieldname15;
    case "plastic2": return fieldname16;
    case "plastic3": return fieldname17;
    case "plastic4": return fieldname18;
    }
    break;
    case "fabric":
    switch(fieldname14){
    case "fabric1": return fieldname20;
    case "fabric2": return fieldname21;
    case "fabric3": return fieldname22;
    case "fabric4": return fieldname23;
    }
    break;
    case "wood":
    switch(fieldname7){
    case "wood1": return fieldname24;
    case "wood2": return fieldname25;
    case "wood3": return fieldname26;
    case "wood4": return fieldname27;
    }
    break;
    }
    })()

    But the form now appears as if the dependencies do not exist, and shows all the fields of the form, SEE FORMinstead of showing just what was selected appears as if I did not put this formula SEE HERE
    and does not show the desired result in the end.

    CAN YOU SEE WHATS WRONG?

  4. codepeople
    Member
    Plugin Author

    Posted 8 months ago #

    Hi,

    I've checked the form structure on your website, with the latest version of plugin, and it is working fine. I recommend you upgrade to the latest version of plugin.

    Best regards.

  5. ruicampos
    Member
    Posted 8 months ago #

    I have the version 1.0.1, this is not the latest version?

    or I did not understand you, or, I may have poorly explained the problem,
    the problem is it is showing all the form fields, SEE FORM.
    Instead of appearing as desired, only the dependencies of the selected, as it appeared before placing this formula.

    Thanks

  6. codepeople
    Member
    Plugin Author

    Posted 8 months ago #

    Hi,

    We've made some updates, and corrections, using the same version of plugin, so it maintains the same version number but includes some corrections.

    I'll need the WordPress access to check the form's settings in your website.

    Please, contact me through our support page, because the information required is sensible and this forum is public:

    http://wordpress.dwbooster.com/support

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.