$(".textarea").keyup( function(ev) {
var k = ev.keyCode;
var inp = ev.target;
if( inp.readOnly && k >= 42 && k <= 90 ) { // an alphanumeric
inp.readOnly = false;
inp.select(); // without this IE do not accept typed in characters at all
// i tried this:
var sev = $.Event("keypress", {keyCode: k, which: k});
// and that:
var sev = $.Event("keypress", ev);
$(inp).trigger(sev);
}
} );
Whatever I tried, the first typed character is lost, the second goes to the control.
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.