Set up hide/show logic based on a calculated total

  • snawsssurvey.tesda
    Asked on August 11, 2022 at 2:30 AM

    For instance, I want the sum to either be 0% or 100%.
    If the answer is either:

    • Not equal to 100%
    • Greater than 100%
    • Less than 0

    An error message should appear.

    I am only able to do this successfully in the three instances above but I dont want the error to appear when the answer is 0%

    1660199092 62f4a0b4ea70e  Screenshot 10

  • Billy JotForm Support
    Replied on August 11, 2022 at 3:38 AM

    Hi there!

    Thank you for reaching out to Jotform Support. I understand the issue but will need a bit of time to work out a solution. I’ll get back to you shortly.

    We appreciate your patience and understanding.

  • Billy JotForm Support
    Replied on August 11, 2022 at 3:47 AM

    Thanks for patiently waiting. Please disable all the conditions attached to A1. Total Full Time permanent [ Must be equal to 100%, if any] and use the one below:

    1660203899 62f4b37b2ff2f  Screenshot 10

    Result:

    1660203909 62f4b38549440  Screenshot 21

    By the way, you want to make sure that your users will not be able to edit the value of the total. You can set its content as read-only by following the guide below:

    1660204002 62f4b3e288270  Screenshot 32

    Sample form: https://www.jotform.com/222222141220938

    Let us know if there’s anything else we can help you with.

  • snawsssurvey.tesda
    Replied on August 14, 2022 at 3:48 AM

    Thank you for your reply.

    It still did not work, I don't want the "error message" to appear when the answer is 0. The answer should only be either 100 or 0 (0 is when there are instances that there are no such employees hired by the companies).

    However, I can't seem to find out how that will work.

    Say t is the total, then the domain should be:

    D: {t is an element of positive real numbers| t=100 or t=0}

    Hence, there should be conditions where

    (t<100 or t>0) and (t=100 or t=0)

    Is there a way I could do an if-else conditions via CSS?

    Btw, appreciate the additional information about the read-only content function.


  • Sheena JotForm Support
    Replied on August 14, 2022 at 6:03 AM

    Hello there,

    If you only want the sum to either be 0% or 100%, you can simplify your condition to this:

    1660471122 62f8c752dc24e  Screenshot 10

    Result:

    1660471401 62f8c8693ce4d  Screenshot 21

    Let us know if this would work for you.