I have many numeric input fields on a slide and a calculate button. I would like a pop up to say "All fields are required" for the button to execute. So if there is a null input it won't allow the user to continue.
The attached example asks for four values to be input and then calculates the sum of those values when the Calculate button is selected. The values are initially set to zero and the Calculate button will only work if all four values are greater than zero. If any one or more of the values are still zero, a message appears and no calculation takes place.
Thanks Michael! that would work, but I wouldn't want to reset them though. When they click calculate the value NaN appears where the calculation should be. Is there java to say if NaN displays, change the NaN error text for example to "All fields required"?
Thank you for your help everyone!! I got it to work.
I made a layer and put white boxes over the NaN errors that are created when a learner doesn't input all fields. Then I create a a show layer trigger when the variable = NaN, and a hide layer trigger when the variable does not = NaN
6 Replies
You could the "All fields are required" message to a layer and show that layer if any of the inputs is 0 when user clicks the calculate button.
Hi Mary,
The attached example asks for four values to be input and then calculates the sum of those values when the Calculate button is selected. The values are initially set to zero and the Calculate button will only work if all four values are greater than zero. If any one or more of the values are still zero, a message appears and no calculation takes place.
Hope this helps. :)
Thanks Michael! that would work, but I wouldn't want to reset them though. When they click calculate the value NaN appears where the calculation should be. Is there java to say if NaN displays, change the NaN error text for example to "All fields required"?
Add a trigger to set the calculation field to 0
Ned - this is interesting! I'll try this next!
This post was removed by the author
Thank you for your help everyone!! I got it to work.
I made a layer and put white boxes over the NaN errors that are created when a learner doesn't input all fields. Then I create a a show layer trigger when the variable = NaN, and a hide layer trigger when the variable does not = NaN
This discussion is closed. You can start a new discussion or contact Articulate Support.