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

No Comments

Category JavaScript/Ajax, Web

You can follow any responses to this entry through the RSS 2.0 feed.

No Responses to “Build a dynamic JavaScript Promo Box using input text and show/hide div layers.”




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

By submitting a comment here you grant Jake Rutter – Front-End Developer and Designer, CSS, JavaScript and jQuery, PHP, Wordpress, Expression Engine, Magento a perpetual license to reproduce your words and name/web site in attribution. Inappropriate comments will be removed at admin's discretion.