Populate textbox on radiobutton click

I have a texbox named "ServeeAddress1" with text in it, which I need to send to the 2nd textbox, "ServedAddress" when i click a radiobutton, so they both then have the same text. Here is the code I tried and it is not working. I get an error in the javascript that says, "object required"

<script type="text/javascript" language="javascript">
function setText()
document.getElementById("ctl00_ContentPlaceHolder1_tabcontainer1_tabpanel4_ServeeAddress1").value == document.getElementById("ctl00_ContentPlaceHolder1_tabcontainer1_tabpanel5_ServedAddress").value;

<asp:RadioButton ID="Radio1" runat="server" Text="Address 1" onclick="setText();"  />

<asp:textbox id="ServeeAddress1" runat="server"/>
<asp:textbox id="ServedAddress runat="server"/>

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
>>document.getElementById("ctl00_ContentPlaceHolder1_tabcontainer1_tabpanel4_ServeeAddress1").value == document.getElementById("ctl00_ContentPlaceHolder1_tabcontainer1_tabpanel5_ServedAddress").value;

should be as:

document.getElementById("ctl00_ContentPlaceHolder1_tabcontainer1_tabpanel4_ServeeAddress1").value = document.getElementById("ctl00_ContentPlaceHolder1_tabcontainer1_tabpanel5_ServedAddress").value;

Two equals signs checks equality between two things (like in an if statement), 1 equals sign is for when you are assigning a value to something.
mlg101Author Commented:
OK, I tried that, thank you, but it still doesnt work. Now the error says document.getElementById is Null or not an object. any ideas?
could you please copy pastew the browser view source HTML
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
can help double check what is "ctl00_ContentPlaceHolder1_tabcontainer1_tabpanel4_ServeeAddress1" in your page? Is it a form element, or a layer (div), etc? if it's a layer, try use innerHTML instead, like:

document.getElementById("ctl00_ContentPlaceHolder1_tabcontainer1_tabpanel4_ServeeAddress1").innerHTML = "new value";

of course, before that, make sure object "ctl00_ContentPlaceHolder1_tabcontainer1_tabpanel4_ServeeAddress1" exists in your page?

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
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.