Support » Plugin: Caldera Forms - More Than Contact Forms » Conditional Show/Hide not working correctly with HTML/Calculation fields

  • Resolved mason3t

    (@mason3t)


    Hello,

    I am having an issue with HTML fields and calculation fields not working correctly when using conditional show/hide on them.

    Here is my issue:
    I have a calculation field that is supposed to update based on values entered in other fields (I used manual formula option with magic tags). It starts out hidden, then based on the user selecting yes in a dropdown field, it is displayed. However, when it is displayed the calculated value is blank. The only way to get the correct number to show up is to edit the field that the calculation is based on.

    The other way that I had tried of doing the same thing was to use a calculation field that is always ‘visible’ (although hidden from the user by css) that will always have the correct calculation, this part works. Then, I use an HTML field and magic tags to include the calculation result. However, the issue with this is that the conditional show/hide does not work on the HTML field (it will HIDE just fine, but does not reappear upon picking yes in the dropdown). Sometimes it will reappear when I change something unrelated that causes other fields to show (using a completely different condition). Unfortunately, my form is very complicated, and this issue was not reproducible on a simple form (both of the above situations worked fine).

    I can send the exported json of the form as well as a link to the current form (privately) if that is needed.

    Thanks,
    Mason

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor christiechirinos

    (@christiechirinos)

    Hi Mason, thanks for using Caldera Forms, that means a lot to us 🙂

    Your first issue sounds like expected behavior. The field is hidden, so once it is shown, it’s not doing anything until we ask it to do something. That makes sense, although I see how it is inconvenient for your use case and will bring this to our dev team’s attention next time we look through the uses in this forum.

    Your attempted solution is exactly what we would recommend. The piece you are missing is that you need a secondary condition, that is counter to the HIDE condition you have, to SHOW the condition again after hiding it. I know it’s a little odd. Computers are much more literal than we are 🙂

    I hope this is helpful, and please let me know if you have any other questions. As for taking a look at form exports, we do this to limited scope in Priority Support. Feel free to review the Terms & conditions, which outline the scope of premium support, here: https://calderaforms.com/pro/terms-of-service/

    Christie,

    Thanks for the reply. I just tried it out, unfortunately what you instructed me to do is not possible. I can only apply one condition per field (the checkbox is disabled in other conditions). I used a show condition originally, but the behavior is the same using a hide condition. I did notice that the html field seems to follow the behavior of the calculation field. That is, a pure html field (no magic tags) will show/hide just fine. However, if you include magic tags, it will only show once the values of the magic tags change. In my case, when the calculation for shows up blank, the html field is hidden, then when I change the value of the field that affects the calculation, the calculated value appears and the html field appears.

    Also, I don’t think this is expected behavior. As I said towards the end of my last post, it is not reproducible. I have not looked at it for a couple of weeks, but when I tried to reproduce the problem on a simpler form, I could not (basically I just extracted only the affected fields and conditions from the complicated form). I will look back at my simple form test and let you know, but I am fairly sure I reproduced the conditions exactly and it worked as I had originally expected it to. So unless the form engine is purposely delaying calculations when there are a lot of fields (possible I suppose, maybe to avoid lag?), this should not be happening.

    Finally, I have found another problem. If fields are hidden, the values come up as blank in the email to the client (despite the fields having a default value). This I can see being expected behavior, but I need a workaround to this, so that clients do not see a blank value in the email.

    Thanks,
    Mason

    Plugin Contributor christiechirinos

    (@christiechirinos)

    Hi Mason, you could use a magic tag in a text field on a separate page that the submitter can’t access to display the email despite hiding it.

    Hello,
    I still have the same issue here with a more complexe html. Could you do something cause I don’t have any workaound.

    Thanks a lot.
    Cédric.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Conditional Show/Hide not working correctly with HTML/Calculation fields’ is closed to new replies.