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 php session start?
Will php die?
How to replace a substring in a given string?
Why many companies are switching their current business language to php? Where php basically used?
What is the Default syntax used in PHP?
What is the use of count() function in php?
Write a program to get lcm of two numbers using php?
How cookies are trported from browsers to servers?
What is difference between ksort() and usort() functions.
What is config file in php?
How to find a substring from a given string in php?
What is a php trait?
Tell me is it possible to submit a form with a dedicated button?
Explain some of the php array functions?
How to reset/destroy a cookie?