Closed gulumige closed 4 years ago
Using type='number'
does not necessarily stop users from entering text that isn't a valid number notation. Some browsers do forbid invalid notation, others merely flag the field's contents as invalid. It also denies the use of any of the newer literal number formats—though, I don't really consider that an issue for <<numberbox>>
. The point is that it's not a panacea, you still need to check what you're getting from the player.
That said. The <<numberbox>>
macro should have been using something, either type='number'
or a pattern
, to restrict the field to a valid number format. Thus, I'm marking this as a bug and correcting the oversight.
Thanks for the report.
Ah, I see. I should use more then one browser to test with in the future.
It does seem like adding text or leaving the field blank using type='number'
defaults to 0, not NaN
. That could be a worthwhile note to add to the documentation.
On the other hand, on touch screens <input type="number">
shows appropriate on-screen keyboard, which is convinient.
Currently there's nothing about the macro that keeps the player from entering anything other than a number into the field. Changing the input type to 'number' would be a natural and (from what I can understand) simple solution to this.