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
Can we extend multiple classes in php?
What is var_dump function in php?
How to call a php function from another php file?
What is prepared statement in php?
How to set cookies in PHP?
What is the difference between static and dynamic websites?
Why print_r is used in php?
Why namespace is used in php?
Is php pass by reference or value?
Is python similar to php?
What is http php?
What is $_ server request_method == post?
Tell me what does pear stands for?
How to receive a cookie from the browser?
What is php written in?