Hi,
I can't seem to reference my textbox from my javascript.
on the aspx:
| <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" EnablePageMethods="True"> |
| <Scripts> |
| <asp:ScriptReference Path="scripts.js" /> |
| </Scripts> |
| </asp:ScriptManager> |
| <table cellpadding="0" cellspacing="0"> |
| <tr> |
| <td width="80%"> |
| <%-- <asp:textbox runat="server" TextMode="MultiLine" id="txt" style="WIDTH: 690px; HEIGHT: 260px" rows="16" Columns="79" ></asp:textbox> |
| --%> <telerik:RadTextBox ID="txt" Width="690" Height="260" Rows = "16" Columns = "79" runat="server" TextMode="MultiLine" SelectionOnFocus="CaretToEnd"></telerik:RadTextBox><br /> |
| <asp:TextBox id="txtMsg" Width="400" Runat="server"></asp:TextBox> <input id="btn" onclick="button_clicked()" type="button" value="SEND" class="btn"/> |
| </td> |
script:
| function button_clicked() |
| { |
| var RadTextBox = $find("<%= txt.ClientID %>"); |
| if (RadTextBox == null) { |
| var b = bla; |
| } |
| PageMethods.SendMessage($get("txtMsg").value,$get("hdnRoomID").value,UpdateMessages, errorCallback); |
| $get("txtMsg").value=""; |
| $get("txt").scrollIntoView("true"); |
| } |
RadTextBox is null..
Any idea what I did wrong?
Thanks,
Andreas