Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

- this seems highly specific for a SPA and not server-side

How would you expect users to enter numbers on the server?



form method = ‘POST’ and a submit button. Usually.


A SPA is calling a backend as well... and the backend (SPA or not) still needs to handle the number locale (comma versus decimals), unexpected 'e', etc. Not sure what about this is a JS problem.


FWIW, I’ve never seen an ‘e’ from a number input on the PHP side, probably because it is parsed correctly. I’ve also never seen it from ‘.valueAsNumber’ on the js side either, except rendering big/small numbers but the internal representation was still correct. Using IntlFormat solved that problem IIRC. If you are passing it around as a string, then I imagine it’s a bigger problem.


so... with a number input?


A text input, with form validation / processing done server side, like we've been doing since the 90's.


We've been doing simple JS-based number inputs since the 90s!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: