Validate Zip Code

Suhailnabi
Posted by Suhailnabi under JavaScript category on | Views : 2362
Validate zip code in javascript

function ValidateZipCode(obj)
{
var blnretVal=true;
var regExpr= new RegExp('\\d{5}(-\\d{4})?');
if (obj.value.search(regExpr)==-1)
{
blnretVal=false;
}
return blnretVal;
}

Comments or Responses

Login to post response