how to get runtime control in html?

I am creating a project .in this i want to get address through dropdownlist,if i select country from dropdownlist then another dropdownlist will apper which has the states of crresponding country.same as with state and so on till requerement?


You're looking for a "cascading dropdown". Effectively, your first dropdown, upon selection makes an ajax call which upon success populates the second dropdown and so on.

It's a very common feature (probably the most common along with ajax autocomplete) and a google or two will find you some really solid examples.

I'd strongly suggest using jQuery for such an endeavour.

  <select name="country" onchange="showstate(this.value);">

//script code
 function showstate(ctr)
if (ctr==" ")
if (window.XMLHttpRequest)
    xmlhttp=new XMLHttpRequest();
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
        var x=xmlhttp.responseText;
        var arr = new Array();
        var v=new Array();
        // Create an Option object        
        document.getElementById("DropDownList").innerHTML='<option value="select">Select university</option>';
        for (var i=0;i<arr.length-1;i=i+2)
            document.getElementById("DropDownList").innerHTML+="<option value="+v[i]+">"+v[i+1]+"</option>";

// getstate.php


     $sql="SELECT DISTINCT `state` FROM `tbname` WHERE `country` = '$q'";
     while($row = mysql_fetch_array($result))
     echo $str;

Need Your Help

PHP Convert Unix time to ISO and Subtract an Hour

php mysql time

I'm restructuring my MySQL database, which has several columns in Unix format.

Is it possible to control which libraries apache uses?

apache python-imaging-library libjpeg lsof

Okay, so I had an earlier problem with PIL that is still unresolved. Someone else had this problem and had success by removing the old JPEG library. I can't really do that on my machine, however, a...