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 |
Is the cookies are available on cross domain?
What's the output of the ucwords function in this example?
What's the difference between __sleep and __wakeup?
What function should you use to join array elements with a glue string?
Which is the latest version of php?
what is the url rewriting?how to rewrite the url? give any example
What is fetch array in php?
what are the various PHP Script Optimization techniques?
1 Answers IBM, Krify Software Technologies, TCL,
How can we get the browser properties using PHP?
How can you retrieve data from the mysql database using php?
Are objects passed by value or by reference?
Explain how can we execute a php script using command line?