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


Please Help Members By Posting Answers For Below Questions

Can we extend multiple classes in php?

756


What is var_dump function in php?

770


How to call a php function from another php file?

711


What is prepared statement in php?

795


How to set cookies in PHP?

814


What is the difference between static and dynamic websites?

707


Why print_r is used in php?

732


Why namespace is used in php?

744


Is php pass by reference or value?

749


Is python similar to php?

773


What is http php?

684


What is $_ server request_method == post?

765


Tell me what does pear stands for?

770


How to receive a cookie from the browser?

758


What is php written in?

747