This was something Nao mentioned to me based on my contact form plugin, so I thought I'd run with it a bit more.
There are quite a few places where numbers are required in the admin panel, and right now there's validation done behind the scenes on it, but it occurred to me that using HTML5, we could handle validating those things better in supported browsers, and unsupported browsers can cleanly fall back to what was there before.
I give you <input type="number">.
(This is from Chrome. There is zero JavaScript involved in making this bit work, the browser just does it when trying to save the page.)
I'm gushing a little, because I never really looked at this before but I'm loving what you can do with it, very easily and effectively for newer browsers. I also think it makes the interface more meaningful (because it's clear that you're working with numbers rather than just bare textboxes)
There are quite a few places where numbers are required in the admin panel, and right now there's validation done behind the scenes on it, but it occurred to me that using HTML5, we could handle validating those things better in supported browsers, and unsupported browsers can cleanly fall back to what was there before.
I give you <input type="number">.
(This is from Chrome. There is zero JavaScript involved in making this bit work, the browser just does it when trying to save the page.)
I'm gushing a little, because I never really looked at this before but I'm loving what you can do with it, very easily and effectively for newer browsers. I also think it makes the interface more meaningful (because it's clear that you're working with numbers rather than just bare textboxes)




