I am using this JS to show and hide a textbox when the value for the select box changes.
It shows the textbox alright, but when I want to hide it it won't.
Here is what I have:
Where have I gone wrong?
It shows the textbox alright, but when I want to hide it it won't.
Here is what I have:
Code:
function showField(email_div)
{
var txt = "";
if(document.form1.type.value = "Banner Impressions")
{
txt += "<p>Banner Location:<input type='text' name='bannerloc' value='<?php echo $firstname; ?>' onfocus=\"this.value='';\" /></p>";
document.getElementById(email_div).innerHTML = txt;
}
else
{
txt = null;
document.getElementById(email_div).innerHTML = nill;
}
}
Where have I gone wrong?








