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
What is the use of ajax in php?
Tell me what is the use of the function htmlentities?
Explain mail function in PHP with syntax?
What is the scope of a variable defined in a function?
What is the difference between associative array and indexed array?
Does browser understand php?
What type of language is php?
What is the difference between $name and $$name?
Explain how is it possible to cast types in php?
What is the difference between explode() and split() functions?
What is the difference between php and java?
How can we check the value of a given variable is a number?
What does the unlink() function mean?
Tell me what does $_env means?
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?