validation city name from regex in javascript
Mostly this pattern used for US cities. It will be accept small and capital character, space, desh and full stop.
if (/[^a-zA-Z .,]/.test(txtCity.value)) {
alert('Invalid city name');
}
else {
alert('Valid city name');
}
Comments
Post a Comment