...

View Full Version : Drop Down Messages



Griff
09-03-2006, 09:01 PM
Hello,
I was looking at the following script from http://www.javascriptkit.com and came across a small problem.

Script Reference: http://www.javascriptkit.com/script/script2/combomessage.shtml

It works fine, it's just that I would like to know how I can add more than one field to alter when a different item is selected from the drop down menu.
For example;
When you have "What is JavaScript?" selected, as well as displaying the definition; it displays in a separate text area an example of JavaScript.

Then when you change the option to "What is DHTML?", both values in the text areas change accordingly.

Any help on the issue is appreciated,
Regards;
Griff

dungsport
09-06-2006, 01:53 PM
This is a short example may help you out.


<script language="javascript">
text[0] = 'first text';
text[1] = 'second text';
text[2] = 'third text';
text[3] = 'forth text';
</script>
<select onchange="document.getElementById('test').value = text[this.value];">
<option value='0'>First
<option value='1'>Second
<option value='2'>Third
<option value='3'>Forth
</select>
<div id="test"></div>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum