wldrumstcs
Jul 5th, 2009, 09:21 AM
I have a php/MySQL/AJAX populated suggestion box that updates as users type into it. It is a simple menu, but I have 2 issues. First, when it is empty (ie there is nothing to suggest to the user), the menu appears as a little black speck. I know this is because I have borders around the menu, and I was trying to figure out a way to not display those borders when the menu is empty.
Second, I want the auto-suggest to be anchored to the bottom-left of the textbox above it. The textbox is centered in a column, and I haven't figured out a way to line up my menu with the textbox. I have tried playing around with the "position" attribute, but none of the settings (inherit, relative, etc.) seemed to work.
Here is some code:
(css)
.suggest_link {
background-color: #FFFFFF;
padding: 2px 6px 2px 6px;
}
.suggest_link_over {
background-color: #6699FF;
color: #FFFFFF;
padding: 2px 6px 2px 6px;
}
#search_suggest {
position: absolute;
background-color: #FFFFFF;
text-align: left;
border-top: 0px;
border-left: 1px solid #868687;
border-right: 1px solid #868687;
border-bottom: 1px solid #868687;
}
And the HTML:
<td width="20%"><div align="center">
<input name="addname" type="text" id="addname" class="tb-background" value="<?php echo $input1; ?>" onkeyup="searchSuggest();" autocomplete="off"/></div>
<div id="search_suggest"></div>
</td>
Second, I want the auto-suggest to be anchored to the bottom-left of the textbox above it. The textbox is centered in a column, and I haven't figured out a way to line up my menu with the textbox. I have tried playing around with the "position" attribute, but none of the settings (inherit, relative, etc.) seemed to work.
Here is some code:
(css)
.suggest_link {
background-color: #FFFFFF;
padding: 2px 6px 2px 6px;
}
.suggest_link_over {
background-color: #6699FF;
color: #FFFFFF;
padding: 2px 6px 2px 6px;
}
#search_suggest {
position: absolute;
background-color: #FFFFFF;
text-align: left;
border-top: 0px;
border-left: 1px solid #868687;
border-right: 1px solid #868687;
border-bottom: 1px solid #868687;
}
And the HTML:
<td width="20%"><div align="center">
<input name="addname" type="text" id="addname" class="tb-background" value="<?php echo $input1; ?>" onkeyup="searchSuggest();" autocomplete="off"/></div>
<div id="search_suggest"></div>
</td>