Need JScript code to put same Textbox value in another Textbox (same page / same form)

Need simple JavaScript Solution to Put Same text box text values into another textbox on the same form and same page...

I have this working in runat with code and onkeypress call code BUT the postback re-positioning is irritating including trying to suppress it with maintain...

JScript should cause no post back i assume and be quite easy ?

<%@ Page Language="VB" AutoEventWireup="false" Debug="true" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data"%>\
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>

<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub

    Private Sub MyTextBox_TextChanged(sender As Object, e As EventArgs) Handles MyTextBox.TextChanged
        AddTextBox.Text = MyTextBox.Text
    End Sub
<html lang="en" xmlns="">
<meta charset="utf-8" />
  <form id="form1" runat="server">
        <asp:TextBox ID="MyTextBox" runat="server" onkeypress="AddTextBox_TextChanged" AutoPostBack="true"></asp:TextBox>
        <asp:TextBox ID="AddTextBox" runat="server" Enabled="False" ReadOnly="True"></asp:TextBox>

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chinmay PatelChief Technology NinjaCommented:
Hi Enflow,

Assuming you are not using Jquery

function copyValues()
document.getElementById("TARGET TEXTBOX's ID").value = document.getElementById("SOURCE TEXTBOX's ID").value;

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EnflowAuthor Commented:
Working Now ... Thanks...

Function JS code:

function matchSigs() {document.getElementById("AutoSN_1").value = document.getElementById("SN_1").value;}

Here is Source ASP.NET Textbox

<asp:TextBox ID="SN_1" runat="server" Height="25px" Width="340px" Wrap="False" BackColor="#EAF4FF" Font-Size="Large" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" ToolTip="Head of Household Types In Their Full Name Signature Here" onchange"javascript;matchSigs();"></asp:TextBox>

Here is TARGET ASP.NET Textbox

<asp:TextBox ID="AutoSN_1" runat="server" Height="25px" Width="270px" Wrap="False" BackColor="#F2F2F2" Font-Size="Large" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" ToolTip="Applicant's Signature Goes Here Automatically" Enabled="False" ReadOnly="True"></asp:TextBox>
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.