title: Setting textbox value from datalist item click without postback?
body: <p>I have a <code>datalist</code> within a <code>panel</code> that looks like the following. Each datalist item (with <code>LinkButton</code> and <code>CommandArgument</code>) displays the roomNum.</p>
  
  <p>Without doing <code>PostBack</code>, I'm trying to populate <code>textbox TextBoxRoomNum</code> with <em>RoomNum</em> from <code>Label1</code> in the datalist item. I assume it will be done with <code>javascript</code>.</p>
  
  <pre><code>&lt;asp:Panel ID="PanelRoomDetail" runat="server" style="position:absolute; width:600px; height: 600px; display:none"&gt;
      &lt;telerik:RadTabStrip RenderMode="Lightweight" runat="server" ID="RadTabStrip1" MultiPageID="RadMultiPage1" SelectedIndex="0" &gt;
          &lt;Tabs&gt;
              &lt;telerik:RadTab Text="Assign" Width="200px"&gt;&lt;/telerik:RadTab&gt;
          &lt;/Tabs&gt;
      &lt;/telerik:RadTabStrip&gt;
      &lt;telerik:RadMultiPage runat="server" ID="RadMultiPage1"  SelectedIndex="0"&gt;
          &lt;telerik:RadPageView runat="server" ID="RadPageView2"&gt;
              &lt;div style="width: 600px; height: 200px; "&gt;
                  &lt;div style="width: 600px;"&gt;
                      &lt;asp:DataList ID="DataListFloorThumb" runat="server" RepeatColumns="5" &gt;
                          &lt;ItemTemplate&gt;
                              &lt;div style="width:72px;height:72px"&gt;
                              &lt;asp:LinkButton id="LinkButton1" runat="server"&gt;
  
                                  &lt;div style='background-image:url(&lt;%# Eval("image_path","Styles/Images/{0}") %&gt;)'&gt;
                                      &lt;div style="overflow: hidden;"&gt;
                                          &lt;div style="text-align: left; float:left;"&gt;
                                              &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Eval("RoomNum")%&gt;' CommandName="cmd_RoomNum" CommandArgument='&lt;%# Eval("RoomNum")%&gt;' Font-Names="Calibri" Font-Size="11pt"&gt;&lt;/asp:Label&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/asp:LinkButton&gt;
                          &lt;/ItemTemplate&gt;
                      &lt;/asp:DataList&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;div&gt;
                      &lt;asp:TextBox ID="TextBoxRoomNum" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/telerik:RadPageView&gt;
      &lt;/telerik:RadMultiPage&gt;
  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>This can be easily done if the page does postback, but without postback I assume it requires some javascript, and that's where I'm stuck. I prefer no jquery.</p>
  
  <p>Thanks.</p>