Javascript/jQuery: Input with fixed prefix.

//<input type="text" value="B01" id="MYINPUT"> $("#MYINPUT").select(function(e){ var selSt=$(this)[0].selectionStart; var selNd=$(this)[0].selectionEnd; if (selSt<3) { $(this)[0].setSelectionRange(3, selNd); } });
Keep a fixed prefix (3 chars in this example) in an input[text] component.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.