473,324 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Hiding selected divs

Hello all,

Toggling divs is a popular subject and I have found plenty of
information and was able to make it work. There is only 1 thing I am
still stuck with for quite some time.

I have a dropdown menu and when I select a date from this menu it
displays another select box with times for that day. When I select
another date another dropdown is shown with times. The problem is now
that my page shows two dropdown menus with times.

The dropdown with dates has several dates, so the dropdowns with times
that show increases all the time. The question is how do I hide 1 time
dropdown div as I select another one?

My code:
<form name="hokatexafspraak" method="post"
action="hokatexafspraak.php"><select name="afspraakdatum"
onchange="javascript: dropdown(this); return false;"><option
value="">Kies datum...</option><option value="1182117600">Maandag 18
Juni 2007 (week 25)</option>
<option value="1182290400">Woensdag 20 Juni 2007 (week 25)</option>
</select><div id="1182117600" style="display: none;"><select
name="tijd1182117600"><option value="">Kies tijd...</option><option
value="09.00">09.00</option>
<option value="12.00">12.00</option>
<option value="15.00">15.00</option>
</select></div><div id="1182290400" style="display: none;"><select
name="tijd1182290400"><option value="">Kies tijd...</option><option
value="09.00">09.00</option>

<option value="12.00">12.00</option>
<option value="15.00">15.00</option>
</select></div></form><div id="div_1"></div><SCRIPT TYPE="text/
javascript">
<!--
function dropdown(mySel) {
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
showdiv = document.getElementById(myVal);
showdiv.style.display="block";
}
//--></SCRIPT>

Thanks in advance to solve this last mystery :)

May 30 '07 #1
1 1711
On May 30, 4:26 pm, roland-d <rdalmul...@gmail.comwrote:
Hello all,

Toggling divs is a popular subject and I have found plenty of
information and was able to make it work. There is only 1 thing I am
still stuck with for quite some time.

I have a dropdown menu and when I select a date from this menu it
displays another select box with times for that day. When I select
another date another dropdown is shown with times. The problem is now
that my page shows two dropdown menus with times.

The dropdown with dates has several dates, so the dropdowns with times
that show increases all the time. The question is how do I hide 1 time
dropdown div as I select another one?

My code:
<form name="hokatexafspraak" method="post"
action="hokatexafspraak.php"><select name="afspraakdatum"
onchange="javascript: dropdown(this); return false;"><option
value="">Kies datum...</option><option value="1182117600">Maandag 18
Juni 2007 (week 25)</option>
<option value="1182290400">Woensdag 20 Juni 2007 (week 25)</option>
</select><div id="1182117600" style="display: none;"><select
name="tijd1182117600"><option value="">Kies tijd...</option><option
value="09.00">09.00</option>
<option value="12.00">12.00</option>
<option value="15.00">15.00</option>
</select></div><div id="1182290400" style="display: none;"><select
name="tijd1182290400"><option value="">Kies tijd...</option><option
value="09.00">09.00</option>

<option value="12.00">12.00</option>
<option value="15.00">15.00</option>
</select></div></form><div id="div_1"></div><SCRIPT TYPE="text/
javascript">
<!--
function dropdown(mySel) {
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
showdiv = document.getElementById(myVal);
showdiv.style.display="block";}

//--></SCRIPT>

Thanks in advance to solve this last mystery :)
Ok, got it figured out. Use getElementsByTags to hide selected divs.

Jun 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chris Hughes | last post by:
I have a routine that creates a page with 2 sets of tables with divs around them. Each div tag has a name. The first set of tags are as follows div id="T123" STYLE="display: none;"> div...
8
by: Rob McLennan - ZETLAND | last post by:
Hi, I have set up an external stylesheet, named "print.css", to format the style of all pages printed from my company's website. I've been previewing my changes to the stylesheet by doing...
5
by: mt | last post by:
In a nutshell, I'd like to have a list of items, each of which fills out a small table which displays some info about a particular item(the items being a trouble ticket for a tech support ASP-built...
9
by: middletree | last post by:
I'm doing an ASP-built Intranet app, and am having trouble with a bit of code on the menu I am using. I got it from some free site, but I tried emailing the person whose email address is in the...
39
by: WindAndWaves | last post by:
Hi Gurus I have a page, which looks a bit like this: .... <body> <div ID=id1>................</DIV> <div ID=gsd>................</DIV> <div ID=ewd>................</DIV> <div...
5
by: gregmercer | last post by:
I have the following html sample, where I'd like to have a show and hide two divs, one replacing the other. Following these two divs is a third div (the bluediv) which I would like to have placed...
24
by: Kourosh | last post by:
I have a lot of DIV tags on an HTML page. I want to group some of them so that I can hide them all together at once if needed. What's a good way to do this? I want this to be compatible with at...
1
by: jarrodprice | last post by:
If I had 4 divs, box1, box2, box3 and box4, and I wanted a script to make certain combinations of them visable controlled by a number sequence in a second div called: "1to4". The script should be...
2
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
Based on wether a row is selected in a GridView I need to HIDE the last two columns of a gridview. I do NOT need to make the cells invisible I want to hide the entire column. When I set the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
1
isladogs
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...
0
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.