Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Show/Hide Div's using Drop-Down Menu Form
Old 10-03-2006, 11:20 PM Show/Hide Div's using Drop-Down Menu Form
Junior Talker

Posts: 3
Name: Rhys
Trades: 0
Hi There,

Does anybody know how to make collapsible tables (Show/Hide div's) with a HTML Drop-Down Menu Form?

Ive been looking everywhere but with no luck at all. Most of the info i find is for dhtml menus but i need this to work using a standard html form Drop-Menu.

Any help or location of a script would be much helpful.

Cheers.
RhysG is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-03-2006, 11:34 PM Re: Show/Hide Div's using Drop-Down Menu Form
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
By "HTML Drop-Down Menu Form" do you mean a select box Like this:

Code:
<select name="asd">
<option value="one">1</option>
<option value="two">2</option>
</select>
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 10-04-2006, 12:30 AM Re: Show/Hide Div's using Drop-Down Menu Form
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
<select name="formField" onchange="Javascript function to show or hide divs here">

That would do it.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 10-04-2006, 01:21 AM Re: Show/Hide Div's using Drop-Down Menu Form
Junior Talker

Posts: 3
Name: Rhys
Trades: 0
Thanks for your quick help... Youv'e put me in the right direction, but do you know of a good script or even a tutorial that can help me get this working right im learning and this will be great way to know in future.
RhysG is offline
Reply With Quote
View Public Profile
 
Old 10-04-2006, 08:47 AM Re: Show/Hide Div's using Drop-Down Menu Form
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
Something like this?:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>

	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
		<title>Untitled Page</title>
		<script type="text/javascript"><!--
var lastDiv = "";
function showDiv(divName) {
	// hide last div
	if (lastDiv) {
		document.getElementById(lastDiv).className = "hiddenDiv";
	}
	//if value of the box is not nothing and an object with that name exists, then change the class
	if (divName && document.getElementById(divName)) {
		document.getElementById(divName).className = "visibleDiv";
		lastDiv = divName;
	}
}
//-->
</script>
		<style type="text/css" media="screen"><!--
.hiddenDiv {
	display: none;
	}
.visibleDiv {
	display: block;
	border: 1px grey solid;
	}

--></style>
	</head>

	<body bgcolor="#ffffff">
		<form id="FormName" action="blah.php" method="get" name="FormName">
			<select name="selectName" size="1" onchange="showDiv(this.value);">
				<option value="">Choose One...</option>
				<option value="one">first</option>
				<option value="two">second</option>
				<option value="three">third</option>
			</select>
		</form>
		<p id="one" class="hiddenDiv">This is paragraph 1.</p>
		<p id="two" class="hiddenDiv">This is paragraph 2.</p>
		<p id="three" class="hiddenDiv">This is paragraph 3.</p>		
	</body>

</html>
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 10-17-2006, 12:56 AM Re: Show/Hide Div's using Drop-Down Menu Form
seomumbai's Avatar
Skilled Talker

Posts: 98
Trades: 0
When you select a item in a dropdown menu list then you can hide the tables by using If condition's.
seomumbai is offline
Reply With Quote
View Public Profile
 
Old 10-17-2006, 11:48 PM Re: Show/Hide Div's using Drop-Down Menu Form
bmcoll3278's Avatar
Super Talker

Posts: 118
Name: Brian Collins
Trades: 0
I did it with this script
http://javascript.internet.com/css/page-organizer.html

I just put the info in the links into a java drop down menu so instead of clicking the link you select it from the drop down
bmcoll3278 is offline
Reply With Quote
View Public Profile Visit bmcoll3278's homepage!
 
Old 10-19-2006, 01:50 AM Re: Show/Hide Div's using Drop-Down Menu Form
seomumbai's Avatar
Skilled Talker

Posts: 98
Trades: 0
I think you can use If Else conditions in html also in ASP.NET.
seomumbai is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Show/Hide Div's using Drop-Down Menu Form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24061 seconds with 11 queries