display selected value in dropdown list through javascript
without page refresh
Answer Posted / dhir
<html>
<body>
<script type="text/javascript">
var show
function showSelected()
{
show
=document.me.test.options[document.me.test.selectedIndex].value;
document.write(show);
}
</script>
<form name="me">
<select name='test' onChange='showSelected()'>
<option value='1'>one</option>
<option value='2'>two</option>
</select>
</form>
</body>
</html>
| Is This Answer Correct ? | 169 Yes | 102 No |
Post New Answer View All Answers
How long is session timeout?
Does php 5 support exceptions?
What is the array in php?
How can we access the data sent through the url with the get method?
What is the difference between htmlentities and htmlspecialchars in php?
What is difference between mysql_fetch_array and mysql_fetch_assoc?
Code to open file download dialog in PHP?
How to open a file in php?
Can I use node js with php?
Why namespace is used in php?
What is a static method php?
How to make horizonatl menu and vertical menu responsive
What is the use of $_server["php_self"] variable?
What is namespace and use in php?
Tell me what is the use of isset() in php?