Note that there are some explanatory texts on larger screens.

plurals
  1. POEnable textbox inside Repeater through JS function
    text
    copied!<p>My textbox (asp.net) is inside the DIV and panel in a repeater's details section(toggle) How can i access the textbox in java script function to make it enable upon click of a link button in the same panel. </p> <pre><code> &lt;div id='d&lt;%# DataBinder.Eval(Container, "ItemIndex") %&gt;' class="details"&gt; &lt;asp:Panel ID="Panel2" runat="server" Height="195px" BackColor="gray" Font-Bold="False" ForeColor="Maroon"&gt; &lt;br /&gt; &lt;asp:Label ID="Label1" runat="server" Text="LicenseID"&gt;&lt;/asp:Label&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# DataBinder.Eval (Container.DataItem,"LicenseID") %&gt;' Enabled="False" BackColor="Gray" BorderStyle="None"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>I tried this way but error is showing</p> <pre><code> &lt;script type="text/javascript"&gt; function MyJSFunction() { var tet = document.getElementById("&lt;%=TextBox1.ClientID %&gt;"); } &lt;/script&gt; </code></pre> <p>but following error message is showing. </p> <blockquote> <p>BC30451: 'TextBox1' is not declared</p> </blockquote> <p>It may be inaccessible due to its protection level.</p> <p>EDIT Here is my code in vb.net .But converting to js function i found errors </p> <pre><code> If e.CommandName = "edit" Then DirectCast(e.Item.FindControl("TextBox2"), TextBox).Enabled = True DirectCast(e.Item.FindControl("Textbox2"), TextBox).BorderStyle =BorderStyle.NotSet DirectCast(e.Item.FindControl("Textbox2"), TextBox).BackColor = Drawing.Color.White end if </code></pre>
 

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