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

java - Incorrect order of records in M-M relationship in hibernate -

command line - Use qwinsta in PowerShell ISE -

php - I want to create a website for polls/survey like this http://www.poll-maker.com/ -