drodown

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:
drodown - JSP-Servlet
create dropdown cell in csv or excell from mysql data in php
create dropdown cell in csv or excell from mysql data in php  Hello sir i want to create drodown cell in csv from mysql data is this is possible or not? if this is posible please share answer or reference link Thanks
Advertisements
Ajax drop down and textbox
in advance............   Here is an ajax example which is having a drodown

Ads