我无法复制或自动绑定到第二个文本框。我需要处理哪个事件,onkeyup
或者onblur
?
这是我的代码:
<script type="text/javascript">
function OneTextToother()
{
var first=document.getElementById(txtQuantity).value;
document.getElementById(txtQuantity1).value=first;
}
</script>
<asp:GridView ID="gvOrder" runat="server" OnRowDataBound="gvOrder_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtQuantity" runat="server" onkeyup="javascript:OneTextToother();" >
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtQuantity1" runat="server" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>