I have a price field that allows only numbers to be used. I use the following code in my 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 dials 0 or 00 or 000, etc ... but without errors with numbers that contain 0, but are actually a specific price (for example 300 , 10250, 10).
Is there a way I can do this?
source
share