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 |
> symbol is used to redirect the output of a command. State Whether True or False?
What is meant by urlencode and urldocode?
What do you mean by core php?
What is cakephp framework?
What is polymorphism?
How can I use single quotes in single quotes in php?
Draw the architecture of Zend engine?
What is the difference between echo, print and printf()?
What is a php tag?
How long will it take to learn php?
What is a php 5?
What is the difference between PHP,ASP and JSP?