javascript - How to make textbox half readonly -
i have question textbox in asp.net. have text example : p-70101002-00089-0, , want part : "70101002" readonly , other part users have ability edit. template same numbers change. there opportunity make asp.net or javascript? thank you
you can try this:
var x = $('#myid').val().length; $('#myid').on('keypress, keydown', function(event) { if ((event.which != 37 && (event.which != 39)) && ((this.selectionstart < x) || ((this.selectionstart == x) && (event.which == 8)))) { return false; } });
Comments
Post a Comment