3 ms·
Nice. This seems to solve a common problem for developers building rich UIs. On a similar topic, does anybody have any pointers for implementing keystroke-by-k
by whisk3rs 13y ago
Nice. This seems to solve a common problem for developers building rich UIs.
On a similar topic, does anybody have any pointers for implementing keystroke-by-keystroke character replacement in an INPUT box that doesn't suck? I'd like users to be able to enter "townhall" but have the input value be "TOWNHALL" and there doesn't seem to be a simple way to do this that doesn't fail when the user uses the arrow key or wants to insert more than one character in the middle of an input box.
- redler 13y agoIt's a bit of a workaround, but one approach is to split the problem into two pieces: display and transmission. For display, you can avoid the cursor problems by using: text-transform: uppercase; It's simple, the user experience remains natural, and there are no JavaScript dependencies. For the transmission phase, simply munge the actual entered content (which will not be all uppercase unless the user enters it as such) during the submit event. Of course you'll want to validate input on the server side as well. Edit: clarity.