I have a price field that only allows the use of numbers. I use the following code in the head:
jQuery(document).ready(function($) {
jQuery('#item_price').keyup(function () {
this.value = this.value.replace(/[^0-9]/g,'');
});
});
and this is my field:
<input type="text" minlength="2" id="item_price" name="item_price">
What i'm trying to do now is force the field to be empty if the person types in 0 or 00 or 000 and so on... but without messing up with numbers that contain 0 but are actually a specific price (for example 300, 10250, 10).
Is there any way that i can accomplish this?