Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Javascript-Check US Zipcode.
WhatsApp
Ghanashyam Nayak
4y
6.6
k
0
0
25
Blog
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
>
<html>
<head>
<title>Sample Code</title>
<script type=
"text/javascript"
>
function
CheckUSZipcode(MyZipCode)
{
var
CheckZipCode = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
if
(CheckZipCode.test(MyZipCode))
{
alert(
"Your Entered Zip Code Is Valid."
);
}
else
{
alert(
"Your Entered Zip Code Is Not Valid."
);
}
}
</script>
</head>
<body bgcolor=#00ff00 alink=blue vlink=blue>
<FORM name=
"windowEvent"
>
US Zip Code : <input type=
"text"
name=
"txtuszipcode"
/>
<input type=
"button"
value=
"Check"
name=
"btnUSZipCode"
onClick=
"CheckUSZipcode(txtuszipcode.value)"
/>
</FORM>
</body>
</html>
Javascript-Check US Zipcode.
Up Next
Javascript-Check indian mobile number validation
Ebook Download
View all
JavaScript Interview Q & A
Read by 832 people
Download Now!
Learn
View all
Membership not found