In developing some server side validation I discovered that (the latest Windows versions as of this writing of) Firefox, Chrome and Internet Explorer handle vertical tab characters differently in input type=text
form fields.
I had a hard time trying to paste the character into any of the browsers so I used JavaScript to populate the text input on my test form like this:
document.getElementById('theField').setAttribute('value', "hello\vthere");
You can see some of the client side differences in this JSFiddle.
There are differences in how the browsers:
- display the value in the input field.
- allow JavaScript to fetch the value back out
- render the character when used to populate innerHTML of a
<pre>
tag - send the value to the server.
This table below shows what I found:
Browser | displayed | put into pre-tag | logged to console | received by server
------------------------------------------------------------------------------------
Chrome | hello | hellothere | hellothere | hello
------------------------------------------------------------------------------------
Safari | hello | hellothere | hellothere | hello
------------------------------------------------------------------------------------
Firefox | hellothere | hellothere | hellothere | hello
FF cont. | | | | there
------------------------------------------------------------------------------------
IE | hello there | hello there | hello | hello
IE cont. | | | there | there
------------------------------------------------------------------------------------
Opera | hellothere | hello | hello | hello
Op cont. | | there | there | there
For the console I used each browser's built in developer tools (I couldn't get the JSFiddle to work with Firebug).
Is there a specification on how browsers are supposed to handle this character in this type of form field? If so what is the specification and which browser is following it?