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

When should you use a stored procedure?

0 Answers  


coding for deleting items form data base on select

1 Answers  


i want to need upload above 100mb file,i was successfully upload 75mb using .htaccess file ,but i can put 101mb file,it was not upload..please give some tips..local server its work perfectly but online it doesn't work.. .htaccess file details AddHandler application/x-httpd-php .php php_value post_max_size 200M php_value upload_max_filesize 200M php_value memory_limit 300M php_value output_buffering on php_value max_execution_time 259200 php_value max_input_time 259200 php_value session.cookie_lifetime 0 php_value session.gc_maxlifetime 259200 php_value default_socket_timeout 259200

1 Answers  


Which array function checks if the particular key exists in the array?

0 Answers  


How big is nvarchar max?

0 Answers  


How does html form submit work?

0 Answers  


Why session is required?

0 Answers  


What is singleton pattern in php?

0 Answers  


What is session and Cokkies . How it works . tell some thing about Session_id()

1 Answers   DVS, Net Solution, PVWEBCO,


Explain what are psrs? Choose 1 and briefly describe it?

0 Answers  


Is server side a session?

0 Answers  


Are php sessions cookies?

0 Answers  


Categories