View Full Version : How to hide the Form select option onmouseout IE6?

02-22-2008, 05:36 AM
I am trying to figure it out how to to hide in onmouseout the select options of a form. Below is the code I got so far.

It isn't working in IE6.
I am stuck with this so any help will be greatly appreciated.
The z-index is also a problem in IE6.

Reference page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<script type="text/javascript">

function hideSelectSearchCon() {
var selectSearchCon = document.getElementById("catGroup");

function check_mouse_pos(e) {
if (typeof e == 'undefined') {
e = window.event;
var src = typeof window.event == 'undefined' ? e.target : e.srcElement;
var opt = { 'SELECT': 1, 'OPTION': 1 };

if (typeof opt[src.nodeName] == 'undefined') {
remove_event(document, check_mouse_pos);

function add_event(obj, func) {
if (typeof window.addEventListener != 'undefined') {
obj.addEventListener('mouseover', func, true);
} else {
obj.attachEvent('onmouseover', func);

function remove_event(obj, func) {
if (typeof window.addEventListener != 'undefined') {
obj.removeEventListener('mouseover', func, true);
} else {
obj.detachEvent('onmouseover', func);


<body id="home">

<!-- #search starts -->

<div id="search-container">
<div id="searchleft"><div id="searchright">
<div id="search">
<form action="/cgi-bin/dbsearch/displayList.cgi" method="post">
<select name="catGroup" id="catGroup" onclick="add_event(document, check_mouse_pos);" style="z-index: -2">
<option value="" selected="selected">Todos los Articulos</option>
<option value="Maquinas Ejercicio">Maquinas Ejercicio</option>
<option value="Material Deportivo">Material Deportivo</option>
<option value="Accesorios Deportes">Accesorios Deportes</option>
<option value="Mobliario Urbano">Mobliario Urbano</option>
<input type="submit" border="0" alt="Buscar" id="btn_search"/>
<!-- #search ends -->