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 the difference between array_merge() and array_merge_recursive() in php?
What is regex in html?
What does addslashes do in php?
How to set cookies in PHP?
How to support multiple-page forms?
How to implement a class named dragonball. This class must have an attribute named ballcount (which starts from 0) and a method ifoundaball. When ifoundaball is called, ballcount is increased by one. If the value of ballcount is equal to seven, then the message you can ask your wish is printed, and ballcount is reset to 0. How would you implement this class?
How to add 301 redirects in PHP?
What is active record in php?
Explain mysql_error().
Differences between get and post methods?
What is the purpose of the '.frm' file extension? What do thes file contain?
How to open a file in php?
What does a dependant variable mean?
What exactly is validating and sanitizing?
Tell me how is the ternary conditional operator used in php?