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;     } });    

jsfiddle demo


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -