Title: Complex Fields Dependency
Last modified: January 28, 2023

---

# Complex Fields Dependency

 *  Resolved [medhaa](https://wordpress.org/support/users/medhaa/)
 * (@medhaa)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/)
 * I am sharing the recording of the issue….Can you please let me know where I am
   going wrong?
 * I have gone through the explanation you have provided here: [https://wordpress.org/support/topic/applying-dependency-for-calculated-fied-2/](https://wordpress.org/support/topic/applying-dependency-for-calculated-fied-2/)
 * It worked for me..but I think I messed something up.
 * Can someone please help here?
    -  This topic was modified 3 years, 4 months ago by [medhaa](https://wordpress.org/support/users/medhaa/).
    -  This topic was modified 3 years, 4 months ago by [medhaa](https://wordpress.org/support/users/medhaa/).

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16417590)
 * Hello [@medhaa](https://wordpress.org/support/users/medhaa/)
 * Thank you very much for using our plugin. Please, remove the single line comments
   from the equations ( Ex. // Pumpkin Seeds). If you want to include comments, 
   use the block format (Ex. /*Pumpkin Seeds*/). The plugin minifies the equations’
   code when generate the forms, and the single line comments can break them.
 * Best regards.
 *  Thread Starter [medhaa](https://wordpress.org/support/users/medhaa/)
 * (@medhaa)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16417628)
 * I tried removing the comments and still it doesn’t seem to be working. Actually,
   it seems to me that the equation in that field is not getting executed. I mean,
   if I’m adding any other field in the form, it is not displaying on the page.
 * Here is the recording: [https://www.loom.com/share/13153981cfbc4dfe8a1e4cd8712f0491](https://www.loom.com/share/13153981cfbc4dfe8a1e4cd8712f0491)
    -  This reply was modified 3 years, 4 months ago by [medhaa](https://wordpress.org/support/users/medhaa/).
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16417645)
 * Hello [@medhaa](https://wordpress.org/support/users/medhaa/)
 * Your fields fieldname101 and fieldname102 were configured as dependent on the
   choices in the fieldname7 field.
 * Please, send me the link to the page that contains the form to check it in action.
 * Best regards.
 *  Thread Starter [medhaa](https://wordpress.org/support/users/medhaa/)
 * (@medhaa)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16417648)
 * My website is not yet public…Is there any other way?
 * And fieldname101 and 102 were dependent earlier…but now I removed the field, 
   so the dependency will automatically get removed..right?
    -  This reply was modified 3 years, 4 months ago by [medhaa](https://wordpress.org/support/users/medhaa/).
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16417756)
 * Hello [@medhaa](https://wordpress.org/support/users/medhaa/)
 * In this case, you can export the form and send me the .cpfm file.
 * Please, read the following section in the plugin documentation:
 * [https://cff.dwbooster.com/documentation#import-export-form](https://cff.dwbooster.com/documentation#import-export-form)
 * Best regards.
 *  Thread Starter [medhaa](https://wordpress.org/support/users/medhaa/)
 * (@medhaa)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16418031)
 * I’m not finding the import/export section. Maybe its for pro users.
 *  Thread Starter [medhaa](https://wordpress.org/support/users/medhaa/)
 * (@medhaa)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16418283)
 * Please find the form link here: [https://medhaagrawal.com/recipe-ingredient-calculator/](https://medhaagrawal.com/recipe-ingredient-calculator/)
 *  Thread Starter [medhaa](https://wordpress.org/support/users/medhaa/)
 * (@medhaa)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16418445)
 * Please take a look at this recording where I have tried to explain the issue 
   I’m currently facing: [https://www.loom.com/share/8f9a3e32d6464707aca5af3c7da42677](https://www.loom.com/share/8f9a3e32d6464707aca5af3c7da42677)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16418483)
 * Hello [@medhaa](https://wordpress.org/support/users/medhaa/)
 * Your form has multiple calculated fields managing custom dependencies and affecting
   same fields (fieldname101, fieldname139, fieldname138, fieldname137, fieldname136,
   fieldname135, fieldname134, fieldname133, fieldname132, fieldname131, fieldname130,
   fieldname129, fieldname128, fieldname127, fieldname126, fieldname125, fieldname124,
   fieldname123, fieldname122, fieldname121, fieldname120, fieldname119, fieldname118,
   fieldname117, fieldname116, fieldname115, fieldname114, fieldname113, fieldname112,
   fieldname111, fieldname110, fieldname109, fieldname108, fieldname107, fieldname106,
   fieldname105, etc……..)
 * The equations are evaluated regardless of the calculated fields’ states (active
   or inactive). Why have you not defined the dependencies with a unique calculated
   field?
 * Also, you have opened comment blocks in the equations (`/*`) but not closed them(`*/`).
 * Best regards.
 *  Thread Starter [medhaa](https://wordpress.org/support/users/medhaa/)
 * (@medhaa)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16418496)
 * The above mentioned fields are already deleted. Also, can you please indicate
   the line no. where I have open comments block(/*).
 * Can you please give a little more detail on what you mean by “Why have you not
   defined the dependencies with a unique calculated field?”
 * Is there any way I can share my screen and connect with you directly?
    -  This reply was modified 3 years, 4 months ago by [medhaa](https://wordpress.org/support/users/medhaa/).
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16418559)
 * Hello [@medhaa](https://wordpress.org/support/users/medhaa/)
 * Please note that support does not cover debugging or implementation of user projects.
   For custom coding services, please contact us directly through the plugin website.(
   [Contact Us](https://cff.dwbooster.com/customization)).
 * In some equations you have `/*IGNOREFIELD(fieldname101|n);` (like in the equation
   of the fieldname134 ) and closed them with `*\`, but the correct closing symbol
   is `*/`, with slash, not backslash.
 * Keep in mind the plugin evaluate every equation affected by the modified fields.
 * For example, if you have the fieldname123 field with the equation:
 *     ```wp-block-code
       (function(){
       IGNOREFIELD(fieldname1|n);
       IGNOREFIELD(fieldname2|n);
       if(fieldname3 == 'A') {
       ACTIVATEFIELD(fieldname1|n);
       }
       })()
       ```
   
 * And the field fieldname321 with the equation:
 *     ```wp-block-code
       (function(){
       IGNOREFIELD(fieldname1|n);
       IGNOREFIELD(fieldname2|n);
       if(fieldname3 == 'B') {
       ACTIVATEFIELD(fieldname2|n);
       }
       })()
       ```
   
 * If the user selects the `A` choice in the fieldname3 field, the plugin evaluates
   the equation in the fieldname123, and activates the fieldname1 because `fieldname2
   =='A'` is true. But the plugin evaluates the equation in the fieldname321 (it
   uses the fieldname3 too), and this time, the line of code `IGNOREFIELD(fieldname1
   |n);` hides the fieldname1 again. Since the condition `if(fieldname3 == 'B')`
   is false, the fieldname2 remains hidden too.
 * The correct would be to implement both dependencies in a unique equation:
 *     ```wp-block-code
       (function(){
       IGNOREFIELD(fieldname1|n);
       IGNOREFIELD(fieldname2|n);
       if(fieldname3 == 'A') {
          ACTIVATEFIELD(fieldname1|n);
       } else {
          ACTIVATEFIELD(fieldname2|n);
       }
       })()
       ```
   
 * Best regards.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Complex Fields Dependency’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/complex-fields-dependency/#post-16418559)
 * Status: resolved