display selected value in dropdown list through javascript
without page refresh



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

Post New Answer

More PHP Interview Questions

How to delete an element from an array?

0 Answers  


What is php.ini & .htacess file?

0 Answers  


Can I learn laravel without php?

0 Answers  


What is isset in php form?

0 Answers  


Explain php parameterized functions.

0 Answers  






What is use of echo in php?

0 Answers  


What is a php namespace?

0 Answers  


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?

0 Answers  


What is list function with their uses.

0 Answers  


Difference between mysql_connect and mysql_pconnect?

0 Answers  


What does pear stand for?

0 Answers  


how to make website package setup like desktop software setup ... that front end and backend can include in setup like single package...?

0 Answers  


Categories