I have a form where I want to disable keyboard input. However I still want to postback the form as part of collection so adding the 'disabled' attribute isnt the solution for me.
I have added this code to make the input readonly:
//code to not allow any changes to be made to input field
$(".customreadonly").keydown(function () {
return false;
});
And then I set this class like this:
$("#StartRRP").addClass('customreadonly');
However when I remove the class like this:
$("#StartRRP").removeClass('customreadonly');
The input still wont allow keyboard input. This seems to be trivial, what am I doing wrong ?
Thanks in advance...
disabledattribute, there's also thereadonlyattribute. A field can havereadonlyset and it will still be submitted.