title: Changing label to textbox on javascript
body: <p>First of all I am not really good in english but Ill try to make it understandable as possible</p>
  
  <p>So what I did was create a gridview wherein the column;
   two controls a label and a textbox
     label is set to be visible 
     while textbox is vice versa </p>
  
  <p>here is the client-code of my gridview </p>
  
  <pre><code>&lt;asp:Image ID="img" onclick="javascript:Toggle(this);" runat="server" ImageUrl="~/Images/minus.gif"
                                      ToolTip="Collapse" Width="7px" Height="7px" ImageAlign="AbsMiddle" /&gt;&lt;/a&gt;
                              &lt;asp:Label ID="lbllastname" Height="15px" Width="180px" runat="server" Text='&lt;%# Eval("CourseCatName")%&gt;'&gt;&lt;/asp:Label&gt;
                              &lt;asp:TextBox ID="txtCourseCategory" AutoPostBack="true" runat="server" Text='&lt;%# Eval("CourseCatName")%&gt;'
                                  Font-Size="XX-Small" Font-Names="Verdana" Style="display: none" OnTextChanged="txtCourseCategory_TextChanged"
                                  Height="16px" Width="207px"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
  </code></pre>
  
  <p>I know that it is difficult to find control inside a gridview so what i did is create a atrribute on my server side to be passed on my javascript function
  Here is what I did</p>
  
  <pre><code>Dim txttry As TextBox = DirectCast(e.Row.FindControl("txtCourseCategory"), TextBox)
          Dim labeltry As Label = DirectCast(e.Row.FindControl("lbllastname"), Label)
          labeltry.Attributes.Add("onclick", "javascript:return validate('" + txttry.ClientID + "','" + labeltry.ClientID + "')")
  </code></pre>
  
  <p>And on my javascript ive created a function to call the controls</p>
  
  <pre><code>  function validate(txtobj, lblobj) {
  
          document.getElementById(lblobj).style.display = 'none';
          document.getElementById(txtobj).style.display = 'block';  
      }
  </code></pre>
  
  <p>So that code works and I think it is almost done but when I run my program and click on the label;
  the label hides but the textbox is below like there is a <code>&lt;br/&gt;</code> between then
  I check the codes again but found nothing that could make the textbox below.
  Sir/Madam what do you think is the problem or should I add a CSS for it?
  Or my code is the huge problem? 
  I am open for suggestion be it bad or good.
  By the way I am really new on javascript</p>
  
  <p>Thanks for your time and effort trying to read my problem.</p>