Hello,
I have script
- <script>
- jQuery(function($) {
- $('#fname').bind("change keyup", function() {
- var val = $(this).val();
- var regex = /^\d+$/;
- if (val.match(regex)) {
- $(this).css("background", "red");
- val = val.replace(regex, "");
- $(this).val(val);
- }
- });
- });
- </script>
- <input type="text" id="fname" name="fname">
This works exactly the opposite of what I want.
When wrote in the field, will not be allowed characters except numbers and dot once.
It's about writing price.
Thanks.