I have a select box with information about people in it. When you click on their name in the select box, I'm trying to display information (Name, Address, Height, Weight) about them inside of a <div>. Here is what I have so far:


<SELECT NAME="list1" MULTIPLE SIZE=20  class="set_width" id='developer'>
   <option value=43>John Doe  </option>
   <option value=42>Jane Doe </option>
   <option value=38>Bob Smith </option>


<div id="output">
<script type="text/javascript">

	function onSelectChange(){
		var selected = $("#developer option:selected");		
		var output = "";
		if(selected.val() != 0){
			output = "You Selected " + selected.text();

Now, what I am thinking is that I need to use selected.val() to pull the value (we'll call it id)of each person and have that id correspond with a row in an array. That row contains all of the information that I need.

Does this make sense? How would I go about doing something like this? Any suggestions would be appreciated.

I just realized that I posted this in the wrong java forum. If someone would move it that would be great.

Edited by sops21: Posted in wrong forum.

8 Years
Discussion Span
Last Post by sops21

Java and JavaScript are not the same thing. Java is product of Sun Microsystems where JavaScript is product of Netscape. Java is an programming language, JavaScript is obviously scripting language.
Request to move post to correct section already sent.

Edited by peter_budo: n/a


Thanks for putting in the request. I noticed it was in the wrong forum as soon as I posted it. Sorry.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.