I had to build a dynamic promo box that would show/hide layers depending on which promo code was entered in the box. I searched high and wide on google for a tutorial that would show me how to achieve this, after no such luck I built it myself. I decided I might as well post this code, which might in turn help someone else.

function validate() {
if ((document.promoCode.Specify.value == "promo1" )){
document.getElementById("promo1").style.display = "block";
document.getElementById("promo2").style.display = "none";
document.getElementById("promo3").style.display = "none";
document.getElementById("error").style.display = "none";
//return false;

} else if ((document.promoCode.Specify.value == "promo2" )){
document.getElementById("promo1").style.display = "none";
document.getElementById("promo2").style.display = "block";
document.getElementById("promo3").style.display = "none";
//return false;

} else if ((document.promoCode.Specify.value == "promo3" )){
document.getElementById("promo1").style.display = "none";
document.getElementById("promo2").style.display = "none";
document.getElementById("promo3").style.display = "block";
//return false;

} else {
document.getElementById("error").style.display = "block";
document.getElementById("promo1").style.display = "none";
document.getElementById("promo2").style.display = "none";
document.getElementById("promo3").style.display = "none";
//return false;
}

//return true;
}



next door movie girl themovies cunt gushingtrailers lesbian moviemovies cock massiveadult movie quicktime clipsmovies oralpam tommy movie lee andersonmovies fuck perfectscenes in rape moviesmovie theaters raveanimal amateur porn3d video porn75 sex tipsfree porn 100 picssex pics adult moviesteens about19 teen101teen Mapporno mongoes captin playhousepornography capturingcar mpgs pornpornos caramelstar caramel the porncaptors card pornporn carebearporn carey Mapnipples swollenporn dirtylarge dickssimpsons nudesucking penislady godivabeautiful buttsgirls hogtied Mapgallery miniskirtpreteen undergroundnaked cartoonsstripping menskirts poodlebiker chickvideos handjobmilitary sex Map

Categories: JavaScript/AjaxWeb

0 thoughts on “Build a dynamic JavaScript Promo Box using input text and show/hide div layers.”

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Web

Angular JS Magazine on Flipboard

I have been working with AngularJS for about a year now, trying to learn as much as I can about this growing framework. It’s been a wild ride and I’m going to post a summary Read more…

Top 5

Top 5 Articles : Week of November 25

During the the week of November 25th, I really started to dive into Angular JS. My top 5 articles of the week are mainly about AngularJS, an MVC framework by Google. #1 : AngularJS WebInspector Read more…

eCommerce

How to implement Bronto Email JavaScript Conversion tracking in Google Tag Manager

This tutorial will show you how to setup Bronto Advanced JavaScript Conversion tracking using Google Tag Manager. Bronto Advanced JavaScript tracking gives you more visibility to all of the products that customers are purchasing, then Read more…