Concatenate values in text boxes

2 posts, 1 answers
  1. Aneesh
    Aneesh avatar
    9 posts
    Member since:
    May 2012

    Posted 15 Jun 2012 Link to this post

    I have 3 rad text boxes a,b and c.
    How can I get a+b (concatenate strings) when I focus on c.
    Thanks...
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 Jun 2012 Link to this post

    Hi Aneesh,

    Try the following Javascript to achieve your scenario.

    JS:
    <script type="text/javascript" >
      function OnFocus(sender, args)
       {
         var a = $find("<%=RadTextBox1.ClientID %>");
         var b = $find("<%=RadTextBox2.ClientID %>");
         sender.set_value(a.get_value() + b.get_value());
       }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top