Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7443421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:19:39+00:00 2026-05-29T11:19:39+00:00

I have got two sections with billing and delivery address within a datalist: <asp:DataList

  • 0

I have got two sections with billing and delivery address within a datalist:

 <asp:DataList ID="dldirectory" runat="server" Width="100%" 
    RepeatColumns="1" EnableViewState="False" DataKeyField="Id" >
    <ItemTemplate>

                         <asp:TextBox ID="txtBillingAddress" runat="server" Text='<%# Eval("BillingFullAddress") %>' TextMode="MultiLine" Width="200" Height="150"></asp:TextBox>

                        <asp:CheckBox ID="chkCopy" runat="server" Text="Same as Billing Address." />

                         Address:
                         <asp:TextBox ID="txtDeliveryAddress" runat="server" Text='<%# Eval("DeliveryFullAddress") %>' TextMode="MultiLine" Width="200" Height="150"></asp:TextBox>
                         </ItemTemplate>

            <ItemStyle Width="50%" />
        </asp:DataList>

          <script type="text/javascript">

   $(document).ready(function () {
       $('input:checkbox[id*=chkCopy]').change(function () {
           if ($(this).is(':checked')) {$('input:text[id*=txtDeliveryAddress]').val($('input:text[id*=txtBillingAddress]').val());   }
       });
   });

The above script works fine only when the textbox mode is set to single and the text displayed on the delivery address is copied and pasted on txtBillingAddress when the checkbox is checked, but when the textmode is set to multiline , the jquery fails as textarea is rendered in a different way.

Any ideas how to get exactly the same feauture with asp.net text box set to multi line mode.

Thanks

Updated html:

<textarea name="ctl00$MainContent$CustomersDefaultPaging$ctl00$txtBillingAddress" rows="2" cols="20" id="ctl00_MainContent_CustomersDefaultPaging_ctl00_txtBillingAddress" style="height:150px;width:200px;"></textarea>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:19:39+00:00Added an answer on May 29, 2026 at 11:19 am

    When you use textbox control in multiline mode it renders a textarea so accordingly your selector should be different. input:text selector will look for input fields of type text it will not select the textarea. Try this.

       $(document).ready(function () {
           $('input:checkbox[id*=chkCopy]').change(function () {
               if ($(this).is(':checked'))  {
                   $('textarea[id*=txtDeliveryAddress]')
                   .val($('textarea[id*=txtBillingAddress]').val());   
               }
           });
       });
    

    Since it is a DataList I am sure you have multiple elements on the page So in the above code you should pass the context while selecting textarea’s using checkbox element as reference. Try this

       $(document).ready(function () {
           $('input:checkbox[id*=chkCopy]').change(function () {
               if ($(this).is(':checked'))  {
                   //Assuming every item is rendered as a separate table
                   //If it is inside a div the change it to div
                   var $parent - $(this).closest('table');
                   $parent.find('textarea[id*=txtDeliveryAddress]')
                   .val($parent.find('textarea[id*=txtBillingAddress]').val());   
               }
           });
       });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a ASP.NET 3.5 sp1 site, and on one page I have two
I have got two classes, one a subclass of the other (say Animal and
I've got two PostgreSQL databases that have been created using the same sql file.
I've got two Silverlight Controls in my project, both have properties TeamId. I would
I've got two hard disks in my computer, and have installed Solaris 10u8 on
I have got as follows: use constant ABC => ('one', 'two', 'three'); and I
I have two strings: the first's value is catdog and the second's is got.
I've got a form where I have two radio buttons and two interchangeable controls
If I have two domain names: altcognito.com and say I've got the other following
I have two websites that post news information. I just got a request to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.