Change Gridview Textbox's visible property true false on DropdownLists's Selected index change event using javascript not working
<p>I am making Gridview's Textbox visible true or false when user changes Dropdownlists selectedIndexchange event for that i have done following code</p>

<p>My .CS File code is as below:</p>

<pre><code>protected void gvTaskList_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                HiddenField hdn = (HiddenField)e.Row.FindControl("hdnStatus");
                DropDownList ddl = (DropDownList)e.Row.FindControl("ddlStatus");
                TextBox txt = (TextBox)e.Row.FindControl("txtVal");
                if (ddl != null)
                {
                    ddl.Items.Add("Not Started");
                    ddl.Items.Add("In Progress");
                    ddl.Items.Add("Complete");

                    if (hdn != null)
                    {
                        ddl.SelectedValue = hdn.Value;
                    }
                    //ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
                    ddl.Attributes.Add("onChange", "return myFun(" + "'" + txt.ClientID + "'" +");");
                }
            }
        }
        catch (Exception ex)
        {
            Utility.ErrorList("EmpTaskList--RowdataBound", ex.ToString());
        }
    }
</code></pre>

<p>Note: My combobox and textbox both are in EditTmplate</p>

<p>Javascript code is as below</p>

<pre><code>&lt;script type="text/javascript"&gt;
function myFun(txtControl) {

    var v = document.getElementById("&lt;%=" + txtControl + "%&gt;");
    alert(v);
}
</code></pre>

<p></p>

<p>When i m changing dropdownlist index function is called and alert is showing null.</p>

<p>So can anyone please suggest me what i m doing wrong??</p>
