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
Why should I store logs in a database rather than a file?
What are string functions?
How to convert numbers to strings in php?
Can you specify the "new line" character in single-quoted strings?
How escape single quotes php?
What is the sign to start variables in PHP?
Tell me how a constant is defined in a php script?
Write a hello world program using variable?
What does the scope of variables mean?
What does $_env mean?
Tell me what is the meaning of a final class and a final method?
What is the use of post in php?
How do I stop a php script?
What is the difference between javascript and php?
Which is not a file-related function in php?