display selected value in dropdown list through javascript
without page refresh
Answer Posted / 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 View All Answers
What is cms php?
What is uri routing?
What is the function mysql_pconnect() usefull for?
Explain do you use composer? If yes, what benefits have you found in it?
Which function is used in php to delete a file?
Is salary fixed or variable cost?
What is the difference between array_pop() and array_push()?
What is a php namespace?
Write a program to swap two numbers using php.
What is constructors and destructors?
What is a static variable in php?
Which software is used to run php programs?
What is warning – “cannot modify header information – headers already sent”?
What are php parameters?
Does php have a future?