I have javascript code for checking the zipcode
var regexObj =
/^(?=[^-]*-?[^-]*$)[0-9-]*[0-9]$/;
I need to add one more condition to this,ie
make it so that user has to enter a minimum of 3 characters
Can any one say, how can i modify my regular expression for that
In HTML5, you can use a pattern.
In your example, you would do the following, where 3 is the minimum value and anything after the comma would be a maximum value (in your case, you don't have a maximum value):
<input pattern=".{3,}">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With