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 |
How can we submit from without a submit button?
What is ci in php?
Write down the benefits of php7?
Which method removes the last element from the end of an array?
Which operator is used to concatenate two strings in PHP?
What are php magic methods?
Why do we use htaccess and where?
What is php stack?
How to remove white spaces from the beginning and/or the end of a string in php?
How to change the principal password?
Tell us how to redirect a page in php?
What is the best way to change the key without changing the value of a php array element?