$(".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.
ASKER
ASKER
ASKER
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY
Just a bit confused as to why you have them as readonly, hence "unable to type into it", until they start typing into it?