Hacker News new | ask | show | jobs
by moonchild 2204 days ago
I'm a fan of forms where they automatically add the dashes/spacing (for ssn and cc, respectively), so you don't have to guess if they're needed.
2 comments

I was a fan of that until I experienced that they don't actually test the code. I've had it break in entertaining ways, most recently getting a new monitor from Dell and trying to enter a phone number (on Firefox on Android, both current & Preview) went like this for the number 123-555-1212, typed without dashes:

Enter number, result is: 125-535-2112 .

On the plus side it was predictable and I was able to eventually enter the number something like 2153552121 and have it appear on page as 123-555-1212. When I encountered this a second time a few days later (reordering due to DOA) I discovered pasting the entire number in allowed the 'automatic' nature to add dashes correctly.

The correct answer to me is to strip out non-numbers and then verify the number is a valid phone number (which should be easier than programmatically determining names or dates).

I don't think I've been able to enter them AND they've been necessary since the '90s though.