复制文本框值使用javaScript或jquery将一个文本框复制到另一个文本框

问题描述:

嗨..我是JavaScript和Jquery的新手。我有两个文本框textbox1和textbox2。现在我在文本框1中输入值,它是在更改事件上的复制文本框2。请帮助我



这是我的代码:

Hi.. I am new to JavaScript and Jquery . I have two text box textbox1 and textbox2 . Now i enter the value in textbox 1 it's copy text box 2 on on Change Event .Please Help me

Here is my Code:

<script type="src= http://code.jquery.com/jquery-1.9.1.js"></script>
    <script type="text/javascript">

$(function () {
            $('#<%=CallDesc.ClientID %>').on change(function () {
                $('#<%=txtmessage.ClientID %>').val($('#<%=CallDesc.ClientID %>').val());
            });
        });
</script>

<td>
                        <asp:TextBox ID="CallDesc" runat="server" TextMode="MultiLine" CssClass="textbox"

                            BorderStyle="Solid" BorderWidth="1px" Height="50px"></asp:TextBox>
                    </td>
<td><asp:TextBox ID="txtmessage"  runat="server" TextMode="MultiLine"

                        Width="200px" CssClass="textbox" Height="50px"></asp:TextBox>
                </td>





谢谢



Thanks

(function(){
(function () {


('#<% = CallDesc.ClientID %> ')。on change(function(){
('#<%=CallDesc.ClientID %>').on change(function () {


('#< ;% = txtmessage.ClientID %> ')。val(
('#<%=txtmessage.ClientID %>').val(