/ Published in: jQuery

If someone put text into an input field (or automatic e.g. with a 2d barcode scanner) and you want to replace a part of the input (pattern) then will help this small jquery code snippet.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<input name="field" id="field" type="text" value="" class="delprefix"> <script type="text/javascript"> $(document).ready(function() { $('.delprefix').change(function() { var value = $(this).val(); //alert(value); $(this).val(value.replace(/00040E-/i, '')); }); }); </script>
Comments
