Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Suppose this is my select drop down , i want to display data corresponding to a month , Is that your question ?</p> <pre><code>&lt;select name="monthview" onchange="showUser(this.value)"&gt; &lt;option&gt;&lt;b&gt;Change Month&lt;/b&gt; &lt;option value="1"&gt;January &lt;option value="2"&gt;February &lt;option value="3"&gt;March &lt;option value="4"&gt;April &lt;option value="5"&gt;May &lt;option value="6"&gt;June &lt;option value="7"&gt;July &lt;option value="8"&gt;August &lt;option value="9"&gt;September &lt;option value="10"&gt;October &lt;option value="11"&gt;November &lt;option value="12"&gt;December &lt;/select&gt;&lt;/td&gt; &lt;div id="txtHint"&gt;YOUR NEW DROP DOWN WITH ROWS FROM DB WILL BE HERE &lt;/div &gt; *** AJAX CALL ***: &lt;script&gt; function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } var x=document.myForm.eid.value; xmlhttp.open("GET","databasefetch.php?q="+str,true); xmlhttp.send(); } &lt;/script&gt; PHP SIDE YOU NEED TO RECEIVE THE MONTH VALUE AND THEN SEND IN THE CORRESPONDING ROWS IN A DROP DOWN AS A RESPONSE TO AJAX CALL , LIKE THIS . $month_selected = $_GET['q']; //connect to database $result ="your sql query" //create a drop down now echo "&lt;select&gt;"; echo "&lt;select name='projectassignedto'&gt;"; echo "&lt;option&gt;"; while ($row = mysql_fetch_array($result)) { echo "&lt;option value='" . $row['employeeid'] ."'&gt;" . $row['employeeid'] ."&lt;/option&gt;"; } echo "&lt;/select&gt;"; echo ""; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload