display selected value in dropdown list through javascript
without page refresh
Answer / rrajeswari
Try this code
<SCRIPT LANGUAGE="javascript">
<!--
function OnChange(dropdown)
{
var myindex = dropdown.selectedIndex
var SelValue = dropdown.options[myindex].value
var baseURL = <Some value based on SelValue>
top.location.href = baseURL;
return true;
}
//-->
</SCRIPT>
<select name=select1 onchange='OnChange(this.form.select1);'>
<option>Value 1</option>
<option>Value 2</option>
<option>Value 3</option>
</select>
| Is This Answer Correct ? | 11 Yes | 6 No |
How to Define a Constant in PHP? Is $ symbol necessary?
How can we determine whether a php variable is an instantiated object of a certain class?
How do you pass a variable by value?
Explain about getters and setters in php?
Explain how to execute a php script using command line.
What does the arrow mean in php?
Which is better python or php?
What does csrf token mean?
Is php good for career?
How to convert a character to an ascii value?
what is the url rewriting?how to rewrite the url? give any example
What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?