Any help or a workaround suggestion would be appreciated.
I find that when you click on the field, that it collapses the select option with the value that the keyboard selected. When you click on something else though or when you tab away, it goes back to the original unchanged value that there was before. So no change actually occurs when the list of options is collapsed.
However, when you press a character to select something and then press tab, then the onchange event occurs.
The problem occurs when someone presses a character to pre-select something and then manually collapses then list of options, right? It is expected for the onchange event to not occur when that happens.
that is exactly what happens. The confusing part is that the user, when she clicks on the field, can think that they have in fact selected that value, and the div that normally gets replaced with different info with the onchange event, does not represent the info for the name that the user thought they have selected. Thanks for the reply, hopefully I can figure out a work around for this issue with google
The workaround is for the user to realise that closing the select list without choosing an option from the list, results in no option being selected. It's a useful UI element that allows you to not select something if you don't want to.
I think the confusion comes from the fact, that the value in the element has changed, even though selection has not been made. Since few users are web developers, they would naturally think that they have selected a new value.
The value displayed on the single visible line has changed. The value selected has not changed. You will probably find that the selected entry if there is one is still highlighted if you expand the list out again and that the entry howing when the list is not expanded is NOT highlighted because it isn't selected.
Am I the only one who thinks that is lousy design, to put a value in a field, even though you have not selected it? What value does that serve?
Ultimately what counts is the option displayed when the control loses focus. At that point any change will trigger the onchange event.
I will have to respectfully disagree. What ultimately counts, is that a user of our web pages see something that makes sense. Having the situation where the user can type a letter, and a name pops into the field, and the user clicks that name (in the field, not in the dropdown), the drop down disappears, and the name remains in the field, but the info in the div is not representative of that name, but still contains the info from the previously selected name because the onchange event has not fired. At that point in time, the user will be looking at the page and would see the name they thought they had selected, but the div would have the info for the previously selected name. In the case of my web page, that div contains buttons, and if they clicked on one of them, it would take them to a different page for the selected student, which since the onchange event didn't fire, would not be for the student they thought they had selected. Complicated to explain I know, but I just think it is lousy design by Chrome. It doesn't happen this way in IE.
How many items are in the drop-down list, and how are they used?
It is a misleading form of operation albeit for what I consider is a very rare scenario. A mouse user is unlikely to select via keyboard. If you're stuck using <select>s, the best piece of crutchware I can devise is to blur all <select>s whenever the div in question is hovered. That will at least cause the current selection to be re-displayed. Specify the ID of your div as shown:
for( var i = 0, id; ( id = arguments[ i ] ); i++ )
lh( document.getElementById( id ) );
function boxBlur( )
var boxes = document.getElementsByTagName( 'SELECT' );
for( var i = 0, bx; ( bx = boxes[ i ] ); i++ )
function lh( elem )
elem.addEventListener ? elem.addEventListener( 'mouseover', boxBlur, false )
: elem.addEvent( 'onmouseover', boxBlur );
})( "theDiv" ); // <- Id of div to be hovered. Multiple IDs can be specified, separated by commas.
I think you're right, I can't change Chrome.
The number of names in the drop down can vary up to thousands. I had originally developed my own autocomplete element for this field, but when the number of names in the drop down got very large, it started to get a little "funky" (how's that for a technical term, lol). I guess I'll just have to consider it a educational issue, where users will have to learn to not click in the field to close the dropdown when they see the name in it.
Thanks for your replies.
This topic is now closed. New replies are no longer allowed.