How to limit the Total amount of the "Slider with Calculated Result Widget" to 100%.

  • storeytellerfilms
    Asked on August 12, 2016 at 3:27 AM
    Thank you for this most valuable answer, but...how do I 'hard limit' the result to 100%?
  • Chriistian Jotform Support
    Replied on August 12, 2016 at 3:42 AM

    I assume you are referring to this form: https://www.jotform.com/form/62238004734854? You want to limit the Total Percentage of the widget to 100%.

    How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 40

    You can use the Calculation Formula below to limit the Total Percentage to 100%.

    (#1 + #2 + #3 +#4 + #5 + #6 + #7 + #8 + #9  + #10) / 10

    How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 51

    Here's a cloned version of your form so you can see it in action: https://form.jotform.com/62241343505951 

    How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 62

    Please let us know if you need further assistance.
    Regards.

  • storeytellerfilms
    Replied on August 12, 2016 at 3:57 AM
    Dearest you.
    Thank you, however..., the cloned version doesn't work. Perhaps the
    perimeter should read 100?
    I will experiment and adjust.
    Thank you millions/100.
    ...
  • Chriistian Jotform Support
    Replied on August 12, 2016 at 5:19 AM

    I checked the clone and it seems to work fine on my end. The percentage is calculated correctly. https://form.jotform.com/62241343505951 

    How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 20

    Do you have any further requirements for the widget? Please let us know and we will be glad to assist you further. Regards.

  • storeytellerfilms
    Replied on August 12, 2016 at 7:00 AM

    Christian et al,

    Thank you, indeed, for your attentions, but still the math doesn't 'add up'

    DETAIL:
    The form features 10 separate listings, a schedule from which the user must select a finite percentage (%) of a whole budget (100%) spend.

    The total spend must be represented as 'Total Percentage of Budget Spent '100%',
    Currently the 'result' attributes to 1.00%, not 100%, The total value does not 'hard limit' either.


    As an example, if the user indicates they have spent 66% of budget on Consumables, and (a faulty) 66% on Permanent Acquisitions, the 'Total Percentage of Budget Spens' is 1.32%
    This is not a suitable math.

    Perhaps I could ask you to look again?
    Many thanks.

  • storeytellerfilms
    Replied on August 12, 2016 at 7:02 AM

    Christian,

    One more question:
    If the background of the form is BLACK (as I need it to be), how can I change FONT COLOUR to either WHITE or RED?
  • Chriistian Jotform Support
    Replied on August 12, 2016 at 9:41 AM

    Hi,

    In the Calculation Formula, please change the denominator to 10. Please see steps below.

    How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 40

     

    How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 51

     

    In the scenario you have given above, will the total below be the correct result?How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 62

    Regarding your concern about the form's background, I have moved it to another thread to assist you better. Please see the thread here.

     

  • storeytellerfilms
    Replied on August 12, 2016 at 5:08 PM

    Christiian,

    If you were to consider the Total Budget as a Glass of water, and in this case there are ten straws.
    each straw could syphon off a particular amount according to the thirst of the user/consumer.
    Each straw, in theory, could 'drink' 100%.

    In the first use-case, 100% of the Total Budget could be consumed by 'Fines/Permits/Licenses, resulting in 100% Budget Spend and that would be fine.

    However, if Fines/Permits/Licenses consumed only 25% of the total budget, (leaving 75% of budget available) then that 75% remainder can only be availble amongst the other sliders/variables.

    Currently I cannot do that.

    I have bracketed the equation, adjusted the demoninators and the math still doesn't flow.
    ALSO, the numeric at the slider end now reads up to '10' instead of '100' as I need.

    I do apologise, the need for clarity in this component is quite exacting.

  • David JotForm Support Manager
    Replied on August 12, 2016 at 7:16 PM

    I doubt there is a formula to accomplish what you need with the widget. I think that requires custom programming to discount what has been taken from the 100% total by one of the option, and leave the remaining percentage to the rest of the options.

    Unfortunately, we don't have any other widget to accomplish what you need. If you want to, we could request one to our widgets team, however, there isn't an estimated time-frame for an implementation.

  • storeytellerfilms
    Replied on August 12, 2016 at 7:19 PM

    BDavid,

     

    Well, thats a disappointing result, but at least I know its not from lack of trying.

    Thank you.

  • iwbrb07
    Replied on August 13, 2016 at 12:44 AM

    I just wanted to throw a thought out there. I haven't tested it, and it works in my head, but what if you were to put a hidden field in there that automatically deducted 1000 from the equation to give you your final percentage?

    Edit:

    I cloned your form and added this in to the configuration of the widget. You can play with it, but it does what you want. 

    Calculator

        min = 0 

        default = -1000

        max = 0

  • storeytellerfilms
    Replied on August 13, 2016 at 12:51 AM

    iwbrb07,

     

    I like the idea you propose, it seems sound (in theory), but how to express it? My coding skills are stone-age. Can you offer pointers/suggestions? Thank you.

  • iwbrb07
    Replied on August 13, 2016 at 12:52 AM

    Edit:

    I cloned your form and added this in to the configuration of the widget. You can play with it, but it does what you want. 

     

    Calculator

        min = 0 

        default = -1000

        max = 0

  • storeytellerfilms
    Replied on August 13, 2016 at 12:53 AM

    iwbrb07

     

    Should I add this at the head or tail of the form field?

     

  • iwbrb07
    Replied on August 13, 2016 at 12:56 AM

    Add that code into the configuration of the widget (form field). Click on the wand and you will see your configuration, add it at the bottom of the list.

     

  • storeytellerfilms
    Replied on August 13, 2016 at 12:58 AM

    iwbrb07,

     

    I did, and it does not achieve the goal. :-(

     

  • iwbrb07
    Replied on August 13, 2016 at 12:59 AM

    I do not know css very well, so maybe support could help, but this could probably be hidden with css so it doesn't appear to the user.

  • iwbrb07
    Replied on August 13, 2016 at 1:00 AM

    Here is the form i cloned, it works for me oops, I accidentally put in your forms address , not the one I cloned. here is the right one https://form.jotform.com/62250582456961

  • storeytellerfilms
    Replied on August 13, 2016 at 1:03 AM

    I have removed the calculator, reset the calculation to

    (#1 + #2 + #3 +#4 + #5 + #6 + #7 + #8 + #9 + #10) / 1

     

    now, if only I could hard limit the total to 100!

    Could an expression such as '>100' be the one I need?

     

  • storeytellerfilms
    Replied on August 13, 2016 at 1:07 AM

    apparently not :0(

    What coding language is this made in? sorry I am so noob!

  • storeytellerfilms
    Replied on August 13, 2016 at 1:09 AM

    iwbrb07,

    thank you for updated form, but, alas this version permits each slider to be only 10% of the rule,
    not (potentially) 100% of the rule.

  • iwbrb07
    Replied on August 13, 2016 at 1:15 AM

    I edited that address, before you sent the message. Here is MY VERSION https://form.jotform.com/62250582456961

  • storeytellerfilms
    Replied on August 13, 2016 at 1:22 AM

    iwbrb07,

     

    Nope, still only allows 10% of total budget per slider, not a potential 100%.

    Imagine that the user spent 90% of budget on consumables

    5% of budget on food

    and 5% of budget on wardrobe, hair & makeup,

    Somehow that result must total 100%!

     

  • iwbrb07
    Replied on August 13, 2016 at 1:32 AM

    Change the calculation formula string to

     

     (#1 + #2 + #3 +#4 + #5 + #6 + #7 + #8 + #9  + #10) / 1

  • iwbrb07
    Replied on August 13, 2016 at 1:33 AM

    but this does allow them to calculate over budget, which might be a good thing to know.

  • storeytellerfilms
    Replied on August 13, 2016 at 1:34 AM

    iwbrb07,

     

    I have, that brings it close o right, but it still does not hard limit the ##result## to 100%

    Thank you for your help & support.

  • iwbrb07
    Replied on August 13, 2016 at 1:42 AM

    So this is how I set MY VERSION up:

     

    ------------------------------------

    Configuration

    ------------------------------------

     

    Travel Expenses (%)

       min = 0 

       default = 0

       max = 100

     

    Wardrobe, Hair, Make-Up (%)

        min = 0 

       default = 0

       max = 100

     

    Camera/Sound/Lighting (%)

       min = 0 

       default = 0

         max = 100

     

    Physical Effects or Special Effects (%)

        min = 0 

        default = 0

         max = 100

     

    Feeding Cast & Crew  (%)

        min = 0 

        default =0

        max = 100

     

    Professional Services/Skills  (%)

       min = 0 

        default = 0

        max = 100

       

    Talent Fees (%) 

        min = 0 

        default = 0

        max = 100

       

    Consumables (batteries etc) (%)

        min = 0 

        default = 0

        max = 100

     

    Permanent Acquisitions (%)

        min = 0 

        default = 0

         max = 100

     

    Fines/Permits/Licenses

        min = 0 

        default = 0

        max = 100

     

    Calculator

        min = 0 

        default = -1000

        max = 0

     

    -------------------------------------

    Calculation Formula

    -------------------------------------

     

    (#1 + #2 + #3 +#4 + #5 + #6 + #7 + #8 + #9  + #10) / 1

     

    -------------------------------------

    Result Text 

    -------------------------------------

     

    Total Percentage of Budget Spent ##result##%

     

    -------------------------------------

    Result Precision

    -------------------------------------

     

    0

  • storeytellerfilms
    Replied on August 13, 2016 at 1:46 AM

    iwbrb07,

    yes, we are using identical config text,

    NB The Calculator config text is useless in my version, it just sits there, numb, immobile.

    The real issue is that the ##result## is still not hard limited to 100%

  • iwbrb07
    Replied on August 13, 2016 at 1:52 AM

    Im sorry i couldnt be of more help. But I don't think there would be any foul in allowing the result to go over 100% as it does. Good luck to you!

  • storeytellerfilms
    Replied on August 13, 2016 at 1:54 AM

    iwbrb07,

    Millions of thanks, you've gone above and beyond the call,

    I've tagged the result line with a warning, tis about all I can do.


    Thank you again.

  • Nik_C
    Replied on August 13, 2016 at 4:52 AM

    You could create a condition that will check if the total percentage is more or less than 100% and if it is not equal to 100% you could hide the submit button and show the message for total percentage needed so the users are unable to submit unless they set the total percentage to 100%. 

    I have created an example for you. 

    https://form.jotform.com/62251780115954

    Please let us know if this worked for you.

    Thank you.

  • storeytellerfilms
    Replied on August 13, 2016 at 4:59 AM

    Nic C,

     

    Gosh, thats a lovely, elegant solution. I like very very much!

    How may I obtain the expressions?

     

  • Nik_C
    Replied on August 13, 2016 at 6:26 AM

    You can clone my form and use it or you can create the following conditions in your form:

    To create conditions in the form builder click on the conditions button:

    How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 40

    You can find the conditions here:

    How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 51

     

    And you can follow this guide on how to setup the conditions in your form:

    How to limit the Total amount of the Slider with Calculated Result Widget to 100% Screenshot 62

     

     

    The text I used for error is just a regular text control with the red font color.

    Please let us know if you need more information.

     

  • storeytellerfilms
    Replied on August 13, 2016 at 7:46 AM
    Superb, simply superb!
    Thank you!
    I have curly questions approaching, (multiple text fields with group &
    selective conditionals!)
    I will detail that problem with more accuracy.
    Thank you, thank you, Very appreciative and glad to have such wisdom on
    hand.
    ...
  • Support_Management Jotform Support
    Replied on August 13, 2016 at 12:01 PM

    I'm glad my colleague's workaround fits your requirement. If you have possible followup questions, please don't hesitate to create a new thread and we'll be more than happy to assist you there :)

    Enjoy your weekend!