...

View Full Version : on focus after search



pagedrop
12-12-2011, 09:10 PM
Hello,

I have a search textbox field which populates the results in a dropdown after searched.

But there is no way, to let users to explain to click or use the dropdown to see the results.. thus, I would like to have a focus on the dropdown, so after the user searches through the search textfield, and enter, the dropdown gets the focus so it will user friendly.

can anyone help me on this.
thank you in advance

Philip M
12-12-2011, 09:59 PM
Is this what you are seeking?




<script type="text/javascript">
function selSelect(which) {
document.forms[0].mySelectBox.selectedIndex = which;
}
</script>


The first index of the select list is of course 0, and if you always want that you can hard code it.


<script type="text/javascript">
function selSelect() {
document.forms[0].mySelectBox.selectedIndex = 0;
}
</script>
Quizmaster: What "G" is the national dish of Hungary?
Contestant: Goats

pagedrop
12-13-2011, 12:31 AM
im not sure, the dropdown i have

<asp:dropdownlist id="cmbpart" runat="server" datatextfield="number" datavaluefield="partnumber" Cssclass="label"></asp:dropdownlist>

and i get the values of dropdown from a search textfield results.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum