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
What is difference between readonly and constant?
Write a program in php to reverse a number?
How can we change the value of a constant?
How to convert numbers to strings in php?
What is orm in php framework?
What is the difference between myisam and innodb?
What is abstract class php?
List some features of php that are deprecated in php
How to join multiple strings stored in an array into a single string?
What is php resource type?
Which one is best framework for php?
What is the use session in php?
Are php sessions secure?
Is php easier than node?
Which is true about the singleton design pattern?