onchange display GridView record if exist from database using Javascript
<p>I have an  <code>onchange</code> event from html <code>DropDownList</code> in my code. I have already created a function to handle the <code>OnChange</code> event. </p>

<p>What I am trying to achieve is to load a <code>GridView</code> based on the <code>DropDownList</code> selection.</p>

<p>Below is my <strong>HTML</strong>:</p>

<pre><code>&lt;select id="ddlUnit" style="width: auto" runat="server" name="unitno" onchange="Funchangestatus()"&gt;
    &lt;option&gt;--- Select ---&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>Also see my JavaScript for the same:</p>

<pre><code>function Funchangestatus() {
        PageMethods.GetStatus(document.getElementById('ddlUnit').value, onstatuschange);
}
function onstatuschange(status) {
        var strvalstatus = "";
        strstatus = status[0].split('~');
        document.getElementById("txtstatus").value = strstatus[0];
        document.getElementById("txtstatus").readOnly = true;
}
</code></pre>

<p>How can I achieve this task using JavaScript? kindly suggest</p>