mardi 4 février 2020

How to validate variable "port " in JavaScript to accept only numerical digit or blank value

I want to Validate one Variable named "Port" in my JavaScript to accept only either numerical digit or blank value. I am not sure exactly what Regex I can use to satisfy both condition. Can anyone suggest me logic to use under my if loop to Validate this?

Thanks, Anshu

Aucun commentaire:

Enregistrer un commentaire