Having issues with calculation when show/hide fields are involved

  • intrepidinvestingllc
    Asked on August 18, 2017 at 9:10 PM

    I created a new form entitled McClatchey.  I had to recreate the math fields multiple times to get them to work during preview.  Then I added in conditional hiding of fields and they no longer compute correctly.  I already spent way too much time have to recreate the math fields 3 or 4 times each.  Hopefully, someday, all of your functionality will be compatible internally.

  • liyam
    Replied on August 19, 2017 at 12:30 AM

    Upon checking your form, I noticed a setting where it sets to clear hidden fields on submit. With this, I suggest that you disable this "clear on submit" setting on your form.

    To do this:

    1) Edit your form and go to Settings 
    2) Click Form Settings
    3) Click the Show More button to expand the other hidden options
    4) Change Clear Hidden Field Values to Don't Clear

    Having issues with calculation when show/hide fields are involved Image 1 Screenshot 20

    If the problem persists, please let us know.

  • intrepidinvestingllc
    Replied on August 19, 2017 at 9:01 AM

    I doubt this is the issue since I never once selected submit.  I was just changing values in the input fields to see the response of the output fields.

    When the values would first appear wrong, I would recreate the equations until they were correct again.  Then when I put in a second or third set of test values, the response to the first set of values would become incorrect.

    I know the equations are correct as I have taken them from a spreadsheet that I recreating as a web form.

  • Nik_C
    Replied on August 19, 2017 at 2:50 PM

    Could you please point us to the fields causing this issue since I'm not sure which one of them is not working. I'm entering the values and fields are calculating, so I'm not sure what is wrong when you're testing.

    Also, I noticed that this field has two plus signs:

    Having issues with calculation when show/hide fields are involved Image 1 Screenshot 20

    Since that field is involved in further calculations, it might be the cause of the wrong calculations.

    Please try removing one of plus signs and see if that resolves the problem.

    Thank you!

  • intrepidinvestingllc
    Replied on August 20, 2017 at 8:17 AM

    Thanks for debugging the equation.  I assume that you took out the extra plus sign because when I went in today, it was not there.  I reran the computational tests and the math appears to be working as expected - at least when the conditionals or hiding of the fields are not part of the form.

    Whenever there is hiding from individual field settings or conditionals for hiding, the values either are not computing, or are computing incorrectly as the form does not display as expected.  If there is a setting for a field to be hidden, the conditional will override that hide setting for that field, which is unexpected. 

    For example, the "Test Value" fields, the "Total Payments" fields, and the "Minimum Loan Duration" in Years" are always expected to be hidden.  However, for a "What are you asking for the property?" of 255000 and a "What is the total monthly rent collected?" of 1025, the "Test Value" field and "Minimum Loan Duration in Years" are both visible.

    The reason I discuss visibility in the computation thread is that they appear to be in conflict with one another.  Change "What are you asking for the property?" to 25500 and you will see all fields displayed when "Test Value", "Total Payments" and "Minimum Loan Duration" are expected to be hidden and the conditional is based off of the computation of certain fields.  So, I can't be certain if the computation is failing or the conditional is working improperly.

  • Elton Support Team Lead
    Replied on August 20, 2017 at 10:08 AM

    So I followed your steps and here's what I've observed.

    255000 and 1025 give you 124 value in the number of payments. The total payments and test value fields appear because your condition states hide them if the number of payments value is greater than 180.

    Having issues with calculation when show/hide fields are involved Image 1 Screenshot 30

    The same thing happens when you change 255000 with 25500. The number of payments value becomes lesser so it'd retain the 2 fields but with different values.

    Having issues with calculation when show/hide fields are involved Image 2 Screenshot 41

    Not unless you change 255000 with 25500000 for example. This gives you 12425 value in the number of payments. This definitely hides the fields back.

    So as far as I can see, the form calculation and conditions work as expected.

    Is this not what you are trying to achieve? Or if I have missed something here, please let us know.

    Thanks

  • intrepidinvestingllc
    Replied on August 20, 2017 at 9:23 PM

    Thanks for looking into this.  Unfortunately, no the behavior show is not what is expected.

    The fields "Total Payments", "Test Value", and "Minimum Loan Duration in Years" are manually set to be hidden and appear as such in the form editor.

    The conditional is defined to hide the remainder of the fields associated with the payment option depending on computed values.  It is NOT defined to show fields based upon computed values.

    The conditional is overriding the manual hide setting of the field.  The conditional takes precedence over the field setting.  That is not the expected behavior.  If I define a field as hidden via the toggle (i.e., manually), it should always remain hidden, especially when there is nothing indicating "show" occur.

    I understand that opposite of hide is show, so the basic answer here is to not include a manually hidden field in any conditional that affects visibility.  I am just stating that it is counter-intuitive that the manual, explicit setting is superseded by the conditional.

  • intrepidinvestingllc
    Replied on August 20, 2017 at 9:30 PM

    I just updated my form to not include the three fields that I wanted hidden without regard to the conditional, now I am back to my original problem.

    Only the Cash Offer section appears.  As you have explained above, the fields for Payment Offer #1 should all appear due to the conditionals.  Now that the fields which are required for the conditionals to function are hidden, all fields remain hidden.

    So, it appears that if a field is hidden, it is not being computed.  Or at least not being computed properly.  I can't debug the value of the hidden field without showing it, so I can't say what is happening.

  • Kiran Support Team Lead
    Replied on August 21, 2017 at 11:21 AM

    The form calculations/conditions seem to be little confusing. Please allow me some time to go through the form conditions and calculations and get back to you with relevant information. 

    Thank you for your patience. 

  • Kiran Support Team Lead
    Replied on August 27, 2017 at 1:21 PM

    Sorry for the delay in responding back. I have cloned your JotForm to my account and see that the fields are Total Payments, Test Value and Minimum Loan Duration in Years are set to be hidden from the field properties. As I tried to enter the values as mentioned in your earlier post, I was able to replicate the issue and see these fields are being displayed on the form with the values as shown in the screenshot provided by our colleague.

    After investigating the issue, I found that the following condition on the form is overriding the Hide field property of these fields. 

    Having issues with calculation when show/hide fields are involved Image 1 Screenshot 20

    Based on the calculations, the Balloon payment is not greater than Test Values in both cases and so they are displaying on the form. You may remove these fields from the action set of the condition so they will be hidden always. Also, please review the condition for the Payment offer #2 for the same conflict.

    Hope this information helps! Please get back to us if you need any further assistance. We will be happy to help.