display selected value in dropdown list through javascript
without page refresh
Answer Posted / 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 |
Post New Answer View All Answers
When to use self over $this?
What does php exit do?
What are php keywords?
How is traits used in php?
Which function would you use to format date information in php?
How is it possible to return a value from a function?
How to enable cURL in PHP?
What is php artisan tinker?
List functions available to sort an php array?
What is string and its function?
Tell me how to find the length of a string?
How do I run a php file?
Is it possible multiple inheritance in php?
What is the output of the following php code?
What are the rules in creating php variable?