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 timeout period on session values?
What is php sequence?
What does it mean when it says the csrf token is invalid?
How to join multiple strings into a single string?
What is the basic function to search files for lines (or other units of text) that contain a pattern.
What is php limit?
What is the method to execute a php script from the command line?
What is variable declaration?
What is the difference between pop3 IMAP and MAPI?
Does jwt protect against csrf?
How to set session.gc_maxlifetime properly?
What is difference between sql and php?
Can I use php in visual studio?
When do sessions end?
What is php and its features?