freena
drodown
1 Answer(s)      2 years and 10 months ago
Posted in : JSP-Servlet

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 Pages:
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
Ajax drop down and textbox
in advance............   Here is an ajax example which is having a drodown

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.