473,756 Members | 4,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="hokatexaf spraak" method="post"
action="hokatex afspraak.php">< select name="afspraakd atum"
onchange="javas cript: dropdown(this); return false;"><option
value="">Kies datum...</option><option value="11821176 00">Maandag 18
Juni 2007 (week 25)</option>
<option value="11822904 00">Woensdag 20 Juni 2007 (week 25)</option>
</select><div id="1182117600 " style="display: none;"><select
name="tijd11821 17600"><option value="">Kies tijd...</option><option
value="09.00">0 9.00</option>
<option value="12.00">1 2.00</option>
<option value="15.00">1 5.00</option>
</select></div><div id="1182290400 " style="display: none;"><select
name="tijd11822 90400"><option value="">Kies tijd...</option><option
value="09.00">0 9.00</option>

<option value="12.00">1 2.00</option>
<option value="15.00">1 5.00</option>
</select></div></form><div id="div_1"></div><SCRIPT TYPE="text/
javascript">
<!--
function dropdown(mySel) {
var myWin, myVal;
myVal = mySel.options[mySel.selectedI ndex].value;
showdiv = document.getEle mentById(myVal) ;
showdiv.style.d isplay="block";
}
//--></SCRIPT>

Thanks in advance to solve this last mystery :)

May 30 '07 #1
1 1727
On May 30, 4:26 pm, roland-d <rdalmul...@gma il.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="hokatexaf spraak" method="post"
action="hokatex afspraak.php">< select name="afspraakd atum"
onchange="javas cript: dropdown(this); return false;"><option
value="">Kies datum...</option><option value="11821176 00">Maandag 18
Juni 2007 (week 25)</option>
<option value="11822904 00">Woensdag 20 Juni 2007 (week 25)</option>
</select><div id="1182117600 " style="display: none;"><select
name="tijd11821 17600"><option value="">Kies tijd...</option><option
value="09.00">0 9.00</option>
<option value="12.00">1 2.00</option>
<option value="15.00">1 5.00</option>
</select></div><div id="1182290400 " style="display: none;"><select
name="tijd11822 90400"><option value="">Kies tijd...</option><option
value="09.00">0 9.00</option>

<option value="12.00">1 2.00</option>
<option value="15.00">1 5.00</option>
</select></div></form><div id="div_1"></div><SCRIPT TYPE="text/
javascript">
<!--
function dropdown(mySel) {
var myWin, myVal;
myVal = mySel.options[mySel.selectedI ndex].value;
showdiv = document.getEle mentById(myVal) ;
showdiv.style.d isplay="block"; }

//--></SCRIPT>

Thanks in advance to solve this last mystery :)
Ok, got it figured out. Use getElementsByTa gs 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
3741
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 id="T113" STYLE="display: none;"> etc I want to hide only the divs that start with T as I have others on the page
8
3250
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 File\Print Preview in IE6 and noticed that occasionally the leftmost button of the javascript menu (CoolMenus Version 3.02) on our website is printed. (I have wrapped the javascript that generates this menu in a DIV so that it is concealed from...
5
1549
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 web-based app). There may be zero, one, or many of these per ticket. Since some tickets have many of these items (call them work items), the page can get awful long. I have this part working already. So my proposed solution to make the pages...
9
3356
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 code, but that email addy doesn't work anymore. Since it's Intranet, I put an HTML version on the web for you to look at. The links won't work, of course. Address is
39
3644
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 ID=fac>................</DIV>
5
2202
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 right up directly below to the first or second div, depending on which is showing. If you load the html in Firefox, and then click on the "Edit" link you can see that the first div is hidden, the second div is shown, however the third div is...
24
5867
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 least IE 5. Would it be a good idea to assign all DIV tags in the same group the same "title" attribute? This is what I want to do, but I'm not sure if it's the correct approach, and I'm not sure how to set the style with javascript either: ...
1
1331
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 conditional: when the contents of div "1to4" are "124", <div box1, box2, and box4 automatically show. If the contents of "1to4" are "1234", then all 4 divs should be displayed. The contents of "1to4" start as a custom tag called {{LAYOUT}}, which...
2
2908
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 Visible property on the columns it causes the underlying ObjectDataSource to re-issue the Select statement. How can I hide these columns without double clutching the ODS Select?
0
9297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9904
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9735
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.