Forum Discussion
Can I prevent "NaN" from appearing in numerical entry?
Is there a way to do this? Am using conditions to handle which numbers ARE allowed and to display an error if invalid numbers are entered. But can't get it to stop letters etc from being entered/processed.
Hopefully I'm having a Friday moment and missing something simple
- DougRCommunity Member
update: feature request has been submitted.
- DougRCommunity Member
note: the condition check mentioned in the second paragraph above didn't come across: It should read " IF less than or equal to 0, OR greater than 0"... in other words, all numbers.
- BrendaHeilmanCommunity Member
Glad you found a work around. However, wouldn't it work to set the numeric variable's default value to zero?
- DougRCommunity Member
Brenda,
The default value (that is set when you create the variable) really just determines the initial value of the variable before any other action changes it. It doesn't "restore" the variable to this value in any way after the value is changed, so the default value is only useful for setting initial conditions when the app first starts.
Doug
- PrzemysławHubisCommunity Member
Idid some research and I found JS solution:
Here is link:
https://dl.dropboxusercontent.com/u/26178433/No%20NaN%20output/story.html
And story file:
Thanks Lea for sharing the javascript code here with us!
- MichelleCourtCommunity Member
I'm having this issue now and it's two years down the track and 4 years from the start of this thread! Does the feature request function work? Seems crazy that this bug is still there after such a long time.
Hi Michelle,
Thanks for coming to share your need for this change and feature within Storyline, and I'm sorry it's caused you difficulty as you build your courses. Our team does keep an eye on the ELH forums and that feature request form, and uses all that information when looking at ways to update Storyline. Each feature idea is tracked thru that form and as our team looks at creating them, they focus on how many customers are impacted, what other workarounds or solutions are available, and the overall impact on the product (if it's going to change anything else about the way it works). All that information is used to determine priority and it seems this set up hasn't risen to that highest level yet. I hope that offers a bit more insight into the process and please continue to keep us in the loop on what you'd like to see in Storyline or our other products!
Thanks Miquel! Never too late to pop in and assist as it could certainly help someone in the future :)
Welcome to E-Learning Heroes by the way ☺️
- MiquelCapCommunity Member
Thanks! :)
- DivyaPeruguCommunity Member
- ChrisWalshCommunity Member
@Divya,
Your requirement will be pretty complex because you will require three separate boolean IsNaN variables to separately test each of the numeric values Year, Month and Day, and then display an alternative Age value if any one of them is a NAN value.
This might be easier to do in JavaScript where theNumber.isNaN()
function is readily available. I could help but you would need to provide:- The variable names and types of the DOB and Age fields
- How you are getting the Year, Month and Day from the "Date of Birth" field
- What your triggers currently look like.