I am trying to hide a layer when a text box length is zero, and its
just not working! It hides the content in the layer, but you still
see a little 2 pixel width blip on the screen. I've spent hours
playing with stuff, its a brain cramp. Need someone to state the
obvious for me. Heres my code.....
<style type="text/css" media="screen">
#search_suggest {
position: absolute;
background-color: #FFFFFF;
text-align: left;
border: 1px solid #3366CC;
}
</style>
<script language="javas cript" type="text/javascript">
function OneStrcZeroLeng th(thelayer){
if ( document.getEle mentById('txtSe arch').length == 0){
thelayer.style. display='none';
}
}
</script>
<form id="frmSearch" >
<input type="text" id="txtSearch" name="txtSearch " alt="Search
Criteria" onkeyup="search Suggest();"
onkeydown="OneS trcZeroLength(d ocument.getElem entById('search _suggest'));"
autocomplete="o ff" />
<input type="submit" id="cmdSearch" name="cmdSearch " value="Search"
alt="Run Search" /><br />
<div id="search_sugg est">
</div>
</form>
As you can see from the code, ONKEYDOWN for textbox "txtSearch" , it
calls function OneStrcZeroLeng th, which then checks to see if
txtSearch has a zero length, and if it does, it tells the layer style
to change to display none.
Which it doesn't do. Ive done numerous things to try to correct this,
but to no avail. Any ideas?
Thanks!
JE