Can I prevent "NaN" from appearing in numerical entry?

Nov 16, 2012

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

39 Replies
Sarah Lyon

I have successfully built out a calculation slide that works well when previewed.  I have duplicated the slide in the same scene with the hopes of changing the scenario users will work through.   Before making any changes to the duplicate slide I tested it and it's getting the the "NaN" error.  Why would something work fine then when I duplicate it no longer work?  I have read through the responses above and have not been able to fix the issue.

 

Ken Flieger

NAN is 'Not A  Number' error in JavaScript. If you are not using custom  JavaScript code then it bares down to extremely bad coding on the developer's side. The developer has to trap any strings, Infinity numbers and spaces or any other value the user may enter that is not a number value. Sloppy code writing.