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 create a session? How to set a value in session? How to remove data from a session?
Is there an easy way to delete an element from a php array?
What is cookie in php with example?
how to insert, update data in database
How to get the length of string?
How cookies are trported from browsers to servers?
How to concatenate two strings together in php?
Explain php parameterized functions.
how to install openssl, ISAPI, pdf modules in php 5.2.5 with apache on windows xp.
why we use @symbol before the variable
What are the different types of php variables?
Why do we need abstract class in php?