Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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 fix "headers already sent" error in php

0 Answers  


Do you know how to delete a file from the system?

0 Answers  


What is the use of "enctype" attribute in a html form?

0 Answers  


Difference between mysql_connect and mysql_pconnect in php?

2 Answers  


what is session_set_save_handler in PHP?

0 Answers  






Whether One-line comment begin with pound sing(#) in php?

2 Answers  


Can we embedded directly PHP code into XHTML document? State Whether True or False?

0 Answers  


How to read a file in binary mode?

0 Answers  


What are default session time and path?

0 Answers  


What is the difference between the functions unlink and unset?

6 Answers  


In mail($param1, $param2, $param3, $param4), the $param2 contains__

0 Answers  


How can we extract string 'techinterviews.com' from a string 'http://www.techinterviews.com' using regular expression in PHP?

4 Answers  






Categories