Return to Snippet

Revision: 59014
at August 14, 2012 04:15 by bassdas

Initial Code
<input name="field" id="field" type="text" value="" class="delprefix"> 

<script type="text/javascript">
    $(document).ready(function() {
        $('.delprefix').change(function() {
            var value = $(this).val();
            $(this).val(value.replace(/00040E-/i, ''));

Initial URL

Initial Description
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.

Initial Title
Form input field value replace onchange with jQuery

Initial Tags
form, replace, jquery

Initial Language