How can i get result when ever i click the combo box.....

Hi Developers...My Html page having one combobox and textbox. My problem is when ever i select the combo list then display the related result in the textbox. please give javascript for this .with regardssure....:)-Message was edited by: sure_2912
[288 byte] By [sure_2912a] at [2007-10-3 0:30:19]
# 1

Well you can listen for selection changes like this:

<select name="yourselect" onChange="changedOption()">

...

So every time the user changes the selection the changedOption() javascript function will be invoked. How you would show the "related result" is way to open ended to answer, I don't even know where that information should be coming from.

gimbal2a at 2007-7-14 17:23:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi gimbal2.... Thanks to your reply. Can you send sample code for this.with regardssure...:)-
sure_2912a at 2007-7-14 17:23:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

<%@ page contentType="text/html;charset=windows-1252"%>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>Fruits</title>

<script language="javascript">

function setFruitText(){

document.forms[0].fruitName.value = document.forms[0].fruits.options[document.forms[0].fruits.selectedIndex].text;

}

</script>

</head>

<body>

<form>

<select name="fruits" onchange="setFruitText()">

<option value="1">Apple</option>

<option value="2">Grapes</option>

<option value="3">Mango</option>

<option value="4">Orange</option>

</select>

<input type="text" name="fruitName"/>

</form>

</body>

</html>

jgalacambraa at 2007-7-14 17:23:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Hi friend jagalacambra...Thanks for your code. can you send date and on mouseover show menu examples.with regardssure...:)-
sure_2912a at 2007-7-14 17:23:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...