Hi,
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.
Please help.
Thanks - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-
<html lang="en-US">
-
<head>
-
<title></title>
-
<script type="text/javascript" language="JavaScript">
-
function hideSelectSearchCon() {
-
var selectSearchCon = document.getElementById("catGroup").options[];
-
selectSearchCon.style.visibility = "hidden";
-
}
-
</script>
-
<head>
-
<body>
-
<form action="#" method="post">
-
<select name="catGroup" id="catGroup" onmouseout="javascript:hideSelectSearchCon();">
-
<option value="Select" selected="selected">Select</option>
-
<option value="Select_2">Select_2</option>
-
<option value="Select_3">Select_3</option>
-
<option value="Select_4">Select_4</option>
-
<option value="Select_5">Select_5</option>
-
</select>
-
-
<input type="submit"/>
-
</form>
-
</body>
-
</html>
7 4861 gits 5,390
Expert Mod 4TB
hi ...
you may play with: - function hideSelectSearchCon() {
-
var selectSearchCon = document.getElementById("catGroup");
-
selectSearchCon.blur();
-
}
-
but with that you cannot select the option with the mouse since the mouseout fires when you mouseout the select-box ... what do you really want to achieve? may be you have to combine more events but please explain in more detail what you need ...
kind regards
Thanks for your reply.
I have a top nav drop down menu, then below I have a search. If I select in the search box the select option, then I go to the drop down menu I wouldn't like to see the select option from the search box. However, now I can see the select option drop down menu from the search at the top of the top nave drop down menu.
Basically, I want to achieve that the option select from the search box behaves like the drop down menu above.
http://oaso.net/kitres/
Thanks
gits 5,390
Expert Mod 4TB
hmmm ... with the link you gave i cannot see what you mean (just get a standard page with google-search there is no dropdown?). a search with a dropdown-list? are this categories to search for? why not using the dropdown too for this purpose?
kind regards
Sorry, I didn't type the correct URL.
This is it.
http://oarso.net/kitres/
I have a top nav drop down menu, then below I have a search. If I select in the search box the select option, then I go to the drop down menu I wouldn't like to see the select option from the search box. However, now I can see the select option drop down menu from the search at the top of the top nave drop down menu.
Basically, I want to achieve that the option select from the search box behaves like the drop down menu above.
Thanks
gits 5,390
Expert Mod 4TB
hi ...
i found a working solution for Firefox: - <script type="text/javascript">
-
-
function hideSelectSearchCon() {
-
var selectSearchCon = document.getElementById("catGroup");
-
selectSearchCon.blur();
-
}
-
-
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') {
-
hideSelectSearchCon();
-
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);
-
}
-
}
-
</script>
-
-
<form action="#" method="post">
-
<select name="catGroup" id="catGroup" onclick="add_event(document, check_mouse_pos);">
-
<option value="Select" selected="selected">Select</option>
-
<option value="Select_2">Select_2</option>
-
<option value="Select_3">Select_3</option>
-
<option value="Select_4">Select_4</option>
-
<option value="Select_5">Select_5</option>
-
</select>
-
<input type="submit">
-
</form>
-
and prepared it for IE but it seems that in IE the event-handling is weird with select-elements? ... so i think the best way would be to work around it with a custom dropdown ... or may be we find a IE solution for this too?
kind regards
Thank you so much, it does work in IE7 and Firefox.
However, It doesn't work in IE6.
I am going to keep trying. Otherwise, I would do as you suggest. Use a drop down menu instead of the select option.
http://www.oarso.net/kitres/
thnx alot bro...the code that u have posted here helped me alot..
Sign in to post your reply or Sign up for a free account.
Similar topics
by: dmiller23462 |
last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript
but my end result is I need two text boxes to stay hidden until a
particular option is selected....I've cobbled together the...
|
by: x muzuo |
last post by:
Hi guys,
I have got a prob of javascript form validation which just doesnt work
with my ASP code. Can any one help me out please.
Here is the code:
{////<<head>
<title>IIBO Submit Page</title>...
|
by: srampally |
last post by:
I need the capabilty to hide/show a selection list, just the way its
done at http://www.lufthansa.com (place the cursor over "Group
Companies"). However, I am looking for a javascript that is much...
|
by: David |
last post by:
Hi,
I have some database records which are listed out in a table on an asp
page.
The table is within a <formtag.
At the end of each record (and table row), I have created a <select>
dropdown...
|
by: Norman |
last post by:
Hello,
I have a working Show / Hide form, that works on FF, but what I would
like to do is to be able to display one part when a user clicks on one
radio button and display another part when the...
|
by: rickl2790 |
last post by:
Hi All
I am putting a form together and I need to be able to hide or display elements of the form based on what is selected with a select.
The form is a passenger details entry form and the...
|
by: safiratec |
last post by:
Hi,
I want to show a div depending of the value of a <select> option, using 2 functions hidediv() and showdiv() - it is working fine in firefox, but not in IE (tested with IE 6 and 7). <body...
|
by: fsalvador |
last post by:
Hi,
I need help with this. I am trying to figure it out but I can't.
I have 2 pages. I would like to display in the second page the content of one class and hide the content of the other...
|
by: dkyadav80 |
last post by:
<html>
///
here what shoud be java script for:
->when script run then not display all input text field only display selection field.
->when user select other value for institute only this...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |