0

Hi everybody newbie here need help from all the master

I want to make loading status using combobox onchange

i have code like this

        <table>
                <th>Filter By test</th>
                <tr><td>Contact</td>
                <td><select name="dropdown" id="dropdown"onchange="showUser(this.value)">
                        <option></option>
                        <option value="0">All</option>
                        <option value="1">Support</option>
                        <option value="2">Software Development</option>
                        <option value="3">Software Consultant</option>
                    </select>
                </td></tr>
        </table>
    </form>
    <div class="clr-div"></div>
    <div id="result">
        <?php 


        $this->load->view('table_ticket_admin'); 

        ?>
    </div>
</div>

<script type="text/javascript">
function showUser(str)
{
    if (str=="")
      {
      document.getElementById("result").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 && xmlhttp.status==200)
        {
        document.getElementById("result").innerHTML=xmlhttp.responseText;
        }
      }
    xmlhttp.open("GET","home/search/"+str,true);
    xmlhttp.send();
 }
</script>
2
Contributors
1
Reply
8
Views
3 Years
Discussion Span
Last Post by ryantroop
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.