display selected value in dropdown list through javascript
without page refresh
Answer / 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 |
Can we use php variable in javascript?
What is restful api?
What are different types of errors available in Php?
When do sessions end?
What is the definition of a session?
What is Gd PHP?
What is difference between rest api and restful api?
How to create a web form?
Which operator is used to concatenate two strings in PHP?
How to insert an new array element in array?
Does exist in php?
How break and continue while loop in php?