...

View Full Version : Jump menu query... probably obvious...



many_tentacles
08-21-2007, 05:41 PM
Hi...

I have this code which works well, but rather than buttons (title 1, title 2), I want to achieve the same description change using a jump menu.

I'm pulling my hair out trying to work it out and i'm sure it's simple.

Thanks




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>


<script type="text/javascript">
function PopUp(mesid,txt){
var messobj=document.getElementById(mesid);
messobj.innerHTML=txt;
}
</script>

<title>
test
</title>

</head>

<body>


<a href="#" onclick="PopUp(
'caption','Description 1');">
Title 1</a>

<a href="#" onclick="PopUp(
'caption','Description 2');">
Title 2</a>

<br /><br />
<div id="caption">The description will go here...</div>


</body>

</html>

many_tentacles
08-21-2007, 05:52 PM
i worked it out...


<form id="form1">
<select name="menu1" onchange="PopUp('caption',value);">
<option>unnamed1</option>
<option value="twat">unnamed2</option>
<option value="****">unnamed3</option>
</select>
</form>



<br />
<br />
<div id="caption">The description will go here...</div>

as i said... simple!

many_tentacles
08-21-2007, 06:06 PM
hmmmm, ok...

a new problem now though.

I want to put a link in the description that pops up but this won't let me.

ie...



<option value="Description here <a href="link.html">with a link</a>Title 1</option>


Any ideas???

many_tentacles
08-21-2007, 06:20 PM
ok ok.... worked it out again.



<option value="Description here <a href='link.html'>with a link</a>Title 1</option>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum