Hello i got problem with my select box in HTML. First click on this box sometimes doesn't selecting the value but only "focusing" it? (i don't know that this is a good word for it) I made screen to help You explain what i mean:
What can i do to avoid this? When user will click i have to show the right place on the map
Some parts of my code:
echo '<select id="selector'.$i.'" style=" height: 100%; width: 228px; margin: 2px;" onchange="JumpToPoint(this.value);">';
while($street = mysql_fetch_array($streets, MYSQL_ASSOC))
{
echo '<option value="'.$street['x'].','.$street['y'].'">'.$street['name'].'</option>';
}
echo '</select></div>';
It is any possibility to simulate this focus ? Because only first click is focusing value - the socond, third etc always selecting the right value
I found that the problem is with this function:
jQuery.fn.filterByText = function(textbox) {
return this.each(function() {
var select = this;
var options = [];
$(select).find('option').each(function() {
options.push({value: $(this).val(), text: $(this).text()});
});
$(select).data('options', options);
$(textbox).bind('change keyup', function() {
var options = $(select).empty().data('options');
var search = $.trim($(this).val());
var regex = new RegExp(search,"gi");
$.each(options, function(i) {
var option = options[i];
if(option.text.match(regex) !== null) {
$(select).append(
$('<option>').text(option.text).val(option.value)
);
}
});
});
});
};
But i don't know where
Thanks in advance for help.