I have to put an "onchange" event in database dropdown i.e when i select any element from database dropdown then corresponding table should be shown in dropdown menu,pLz help me i am in deep trouble.
See my code below:
i have two file.
(1) lib.php
(2)conn.php
See code of :lib.php" :-
/*
function : showlist fucntion is used for display the list
input : $abc = name of the drop down
$db_list = result set of the query
$value = value of the option
output : display string in the form of list (option)
*/
function showlistindrop($name_dp, $result_list, $value,$location)
{
//
$aa = "<SELECT NAME='$name_dp' onchange='pulldown_menu()'>";
<script language="javascript">
function pulldown_menu()
{
// Create a variable url to contain the value of the
// selected option from the the form named pulldown and variable selectname
var url = document.list.list_database.options[document.list.list_database.selectedIndex].value
// Re-direct the browser to the url value
window.location.href = url
}
</script>
<?
include("lib.php");
$connect=mysql_connect($_POST["host"],$_POST["user"],$_POST["pass"]) or die(mysql_error());
Bookmarks