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
Do you know what is the function func_num_args() used for?
Is php is dying?
Explain Type juggling?
What are the design patterns in php?
Tell me can the value of a constant change during the script's execution?
Which is incorrect with respect to separating php code and html?
Tell me what is the default session time in php?
What does the unset() function means?
Is python similar to php?
What is sticky form in php?
What are the common uses of php?
Can php variables have numbers?
What backslash character will match whitespace?
Tell me what is the definition of a session?
What is the difference between == and === in php?