Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html oncontextmenu="return false">
- <body>
- <script>
- function checkZipCode()
- {
- var validZipCodes = ["00001", "00002", "00003", "00004", "00005", "00006", "00007", "00008", "00009", "00010", "00011", "00012", "00013", "00014", "00015", "00016", "00017" ];
- var enteredZipCode = document.getElementById("inputZip").value;
- if(validZipCodes.indexOf(enteredZipCode) > -1)
- {
- document.getElementById("Message").innerHTML = "We do service " + enteredZipCode + "!";
- }
- else
- {
- document.getElementById("Message").innerHTML = "Sorry, we don't service this area yet.<br><br>But please give us a call to see if we can help you.";
- }
- document.getElementById("Message").style.display = "block";
- }
- </script>
- <style>
- h1 {font-family: "Trebuchet MS";
- color: #fe007e;
- font-size: 35px;
- margin-bottom: 1px;
- }
- .search-btn {
- outline: none;
- display:block;
- float:left;
- width:20%;
- text-align:center;
- font-family:"proxima-nova", sans-serif;
- text-transform:uppercase;
- font-size:15px;
- font-weight:bold;
- color:#FFF;
- background-color:#fe007e;
- -webkit-border-radius: 0 3px 3px 0;
- border-radius: 0px 50px 50px 0px;
- cursor:pointer;
- border:none;
- height:40px;
- font-family:Arial;
- }
- .search-box {
- outline: none;
- width:73%;
- padding:10px 3%;
- display:block;
- float:left;
- background:#dadada;
- color:#3F3F3F;
- font-family:"proxima-nova", sans-serif;
- font-size:15px;
- height:20px;
- -webkit-border-radius: 3px 0 0 3px;
- border-radius: 50px 0 0 50px;
- border:none;
- font-family:Arial;
- }
- #ZipSearchBox {
- width:90%;
- background-color: #fbfcfb;
- text-align:center;
- margin:0px auto;
- padding: 0px 10px;
- border:solid 1px #dddddd;
- font-family:Arial;
- }
- #ZipSearchBox h2{
- margin-bottom:8px;
- font-size:22px;
- font-family:Arial;
- filter: alpha(opacity=80);
- opacity: 0.8;
- }
- </style>
- <div id="ZipSearchBox">
- <h1>
- AREAS WE SERVICE
- </h1>
- <h2>
- Check to see if we work in your area.
- </h2>
- <form id="zipform">
- <div style="margin:auto; padding:20px">
- <input id="inputZip" class="search-box" type="text" value="Enter your zip code" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">
- <input class="search-btn" id="button" type="button" value="Go" onclick="checkZipCode();"/>
- <script>
- var input= document.getElementById("inputZip");
- input.addEventListener("keydown", function (e) {
- if (e.keyCode === 13) { //checks whether the pressed key is "Enter"
- checkZipCode();
- }
- });
- </script>
- </div>
- </form>
- <br>
- <br>
- <h2 style="background-color:#272a26; padding:15px; color:#fff; font-family:Arial; font-size: 20px; display:none" id="Message">
- </h2>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement