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 to delete an element from an array?
What is php.ini & .htacess file?
Can I learn laravel without php?
What is isset in php form?
Explain php parameterized functions.
What is use of echo in php?
What is a php namespace?
I am writing an application in php that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with php?
What is list function with their uses.
Difference between mysql_connect and mysql_pconnect?
What does pear stand for?
how to make website package setup like desktop software setup ... that front end and backend can include in setup like single package...?