jyllan
asked on
How do I copy text from one textbox to another textbox and in a Ajaxtoolkit tabpanel
Hi
I have a problem, I can't copy a textbox to another textbox in ajax toolkit tabcontainer/tabpanel
I get the error: TextboxAddNewCloseName2 is undefined, when I use
onchange="javascript:Textb oxAddNewCl oseName2.v alue = this.value;return true;"
And the error ducument.getElementByID[.. ] is null or not an object
when I use the code onchange="javascript:docum ent.getEle mentById(' <%= TextboxAddNewCloseName2.Cl ientID %>').value = this.value;return true"
See my full code sent by me
I have a problem, I can't copy a textbox to another textbox in ajax toolkit tabcontainer/tabpanel
I get the error: TextboxAddNewCloseName2 is undefined, when I use
onchange="javascript:Textb
And the error ducument.getElementByID[..
when I use the code onchange="javascript:docum
See my full code sent by me
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="_Default2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<cc1:TabContainer ID="TabContainer1" runat="server">
<cc1:TabPanel runat="server" ID="tab1"><HeaderTemplate>tab1</HeaderTemplate><ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
<asp:Textbox ID="txtAddNewCreateName2" runat="server" onchange="javascript:document.getElementById('<%= TextboxAddNewCloseName2.ClientID %>').value = this.value;return true" MaxLength="4" />
<asp:Textbox ID="TextboxAddNewCloseName2" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate></cc1:TabPanel>
</cc1:TabContainer>
<asp:Textbox ID="Textbox1" runat="server" onchange="javascript:document.getElementById('<%Textbox2.ClientID %>').value = this.value;return true" MaxLength="4" />
<asp:Textbox ID="Textbox2" runat="server" /> <br />
</div>
</form>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
I guess you are reffering to a control inside an UpdatePanel from Outside the UpdatePanel. Extend your updatepanel refer below...
I guess you are reffering to a control inside an UpdatePanel from Outside the UpdatePanel. Extend your updatepanel refer below...
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="_Default2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<cc1:TabContainer ID="TabContainer1" runat="server">
<cc1:TabPanel runat="server" ID="tab1"><HeaderTemplate>tab1</HeaderTemplate><ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
<asp:Textbox ID="txtAddNewCreateName2" runat="server" onchange="javascript:document.getElementById('<%= TextboxAddNewCloseName2.ClientID %>').value = this.value;return true" MaxLength="4" />
<asp:Textbox ID="TextboxAddNewCloseName2" runat="server" />
</ContentTemplate></cc1:TabPanel>
</cc1:TabContainer>
<asp:Textbox ID="Textbox1" runat="server" onchange="javascript:document.getElementById('<%Textbox2.ClientID %>').value = this.value;return true" MaxLength="4" />
<asp:Textbox ID="Textbox2" runat="server" /> <br />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
document.getElementById("<