Forum Discussion
Reset Numeric Entry Box so no value shows
I have a question with Correct/Incorrect/Try again options. Someone on the Forum was kind enough to help out with IF, THEN, ELSE logic for try again. When you get Try Again and return to layer with NEB, what you typed in remains. I can set the NEB variable to 0 (Zero), but then learner has to delete the value before typing another response. Is there a way to clear out the original answer so the Numeric Entry Box is completely empty?
- ShivamSharma-58Community Member
Any solution to avoid the NaN?
- MariaCSStaff
Hi, Shivam.
While there isn't a way to set a numeric variable to blank, you're welcome to submit a feature request directly to our team with your suggestion.
As a workaround, as Bill suggested above, you can set it as a text variable and use Javascript to do the calculations.
- WilliamEverh218Community Member
Yuri's solution worked for me. Storyline 360 v. 3.66.28270.0
THANK YOU! Yuri for thinking outside of the box and sharing the solution.
- MatthewKliewerCommunity Member
Thanks, Yuri - works great for my use case!
(Basically preventing unintentional 0 in the results, as well as just reducing extra work for the user to clear it.)It would still be great to see an actual solution in the program, however - this workaround wouldn't work if you needed to do Storyline math with the resulting Numeric Entry values, since they're now Text variables.
(You could with JavaScript coercion, but not with the built-in math functions.)
- ZacharyBrock-faCommunity Member
This is an old thread, but still relevant to me. Any updates on getting this to work with numeric entry fields?
EDIT: I have seen Yuri's solution and got it to work. Ignore me.
- NtambaraFredCommunity Member
To get this to work, just Set "NumericEntry" to value "0" when the "timeline starts on NumericEntry".
- NedimCommunity Member
I recently shared a demo where you can use a text variable to hold the calculation result of multiple number variables. The result is set to a number after the calculation is completed and reset to a string when the calculation is reset. This way, you can set the resulting variable to 'blank', some other character, or a question mark, as demonstrated in the attached demo. This was achieved with simple JavaScript code.