forum

Home / DeveloperSection / Forums / Set textBox.Text=radCombo.Text in javascript

Set textBox.Text=radCombo.Text in javascript

Anonymous User 1897 26-Dec-2014

I am having a <telerik:RadComboBox> and a <asp:TextBox> in my form. i want to display textBox.Text=radCombo.Text in client side on Textchange event of the comboBox. i am using the code for this as:

<body>
    <form id="form1"runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadComboBox ID="cboSample" EnableLoadOnDemand="true" runat="server" Skin="WebBlue" Text ="sample" OnClientKeyPressing  ="func()">
                  </telerik:RadComboBox>
        <asp:TextBox runat="server" ID="txtSample"></asp:TextBox>
    </div>
    </form>
    <script type="text/javascript">
        function func() {
            var cbo =document.getElementById("cboSample");
            document.getElementById("txtSample").Text= cbo.getAttribute("Text");                              
        }
    </script>
</body>

what i am doing wrong? how can i achieve the goal


Updated on 26-Dec-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By