drodown
how to display selected dropdown value in textbox without using form. also want to use that value in query...
View Answers
July 20, 2010 at 12:25 PM
Hi Friend,
Try the following code:
<html>
<script>
function getValue(){
var combo = document.getElementById("sel");
var val = combo.options[combo.selectedIndex].text
document.getElementById('val').value=val;
}
</script>
<select id="sel" onchange="getValue();">
<option><--Select--> </option>
<option>Alto</option>
<option>Nano</option>
<option>Innova</option>
<option> Esteem</option>
<option>Centro</option>
<option>Scorpio</option>
<option>Chevrolet</option>
</select>
<input type="text" id="val">
Thanks
Related Tutorials/Questions & Answers:
Advertisements