JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Spinner resets to zero when another spinner is alteredAsked by HookTours on January 04, 2016 at 08:39 PM
I have a simple form that shows the amount of people attending an event. They are divided into Adults and Children. Children must be accompanied by at least one Adult so I have added a condition: IF Adults Is Equal To"0" Insert "0" into Children. However if the number of Children is selected then the number of Adults is changed, the Children field updates to "0"
How can I stop this from happening?
Randy here, a fellow JotForm user.
Here's the link to a live form based on your specifications.
Like you, I noticed that if we set the condition to Adult = 0, the conditional logic won't work. So I tried the alternative (please look at the conditional logic within the form).
I also added a new condition to disable the spinner button and make sure that the spinner button cannot be manipulated if Adult = 0 (please see animated gif below).
Hope this helps while you wait for the JotForm Support team's reply.
Hi JotForm Support team !
I discovered a glitch / bug on the spinner button. Even when disabled, the spinner can still be manipulated even if the trigger clearly states that if Adult = 0, disable Children spinner button.
(Left click to view actual size)
I can confirm that the spinner for Children does reset to 0 regardless of how many adults are selected.
One workaround I can suggest is to add a hidden number field and a couple of conditions that stores the value of the Children field that will return that value to the Children spinner if the amount of adults is greater than 0.
Here are the two conditions that I added.
As you can see in the GIF below, the Children field does not reset when the amount of adult is greater than 0.
Here is the link to the cloned form where I have applied the fix: https://form.jotform.com/60042241120938
You can also clone it to see the conditions that I set. Here is a guide on how to clone a form: How to Clone an Existing Form from a URL
Do inform us if you need further assistance,
Hi Chriistian, thanks for the workaround you gave to HookTours.
There are however still unanswered questions:
1.) why didn't the conditional logic work properly when it was set to Adults = 0? (Main issue)
2.) why was there a need to create an additional number field (variable) if we can use the existing 2 in the form (adults & children spinner buttons) to create a conditional logic?
(does this mean that there's a bug / glitch and using a number field will circumvent this temporarily?)
3.) in the workaround you provided, the children spinner can still be incremented even if Adults = 0. how can this be prevented? (please see animated gif below)
(the specification given by HookTours was:
Children must be accompanied by at least one Adult
(If Adults is 0 then Children must be 0 too)
(meaning: no adult companion - the child / children can't come - children spinner should be = 0))
Also, thanks for creating a new thread for the bug report i made. It was escalated to the developers by Sammy.
1. I'm not sure what is causing the value to reset back to zero when the adult count is changed to a non-zero value, I'm still investigating the probable causes as to what might be triggering this.
2. The additional field acts a temporary holder for the number of selected children since when the conditions is used directly is overrides the value of the children spinner.
3. Regarding the third question this can be solved by disabling the field but since your reported the disabling option not being acknowledged a ticket has already been opened to address this.
For now my colleagues approach should resolve the issue with the value being reset on the children spinner when the number of adults is changed.
Hi all, Thanks for your help grade4pagasa. You got the form to work how I intended, I also like your use of the disable spinner. I will use this in the finished form. Thanks to Chriistian for your workaround too, it works perfectly for what I need. I can get the form to work now so the matter is resolved.
Thanks again for your prompt replies
On behalf of the support team and special thanks to grade4pagasa, you are very welcome.
If you have any other question, please do not hesitate contacting us. We will be glad to assist.