RadText box New line Problem in Chrome browser

5 posts, 1 answers
  1. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 14 Jun 2013 Link to this post

    Hi,
    I want to enter a new line in rad text box on a button click event. In button click event have added the "\n"  to the exsiting value and this works correctly for IE and Firefox browser, but not working in Chrome browser. Could you please help me to fix this chrome browser issue.





    Thanks



  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jun 2013 Link to this post

    Hi,

    I tried to achieve the same in client side and server side and it worked as expected on my end. Here is the sample code.
    1) JS:
    function addnewline()
    {
      var txtbox1 = $find("<%=RadTextBox1.ClientID %>");
      txtbox1.set_value("\ntest");
      return false;
    }

    2)C#:
    protected void button1_Click(object sender, EventArgs e)
      {
            RadTextBox1.Text += "\ntest";
      }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 14 Jun 2013 Link to this post

    Hi Shinu,
    Thanks for your quick reply. The actual problem is the cursor was on the starting point. it should come to next line. Can u please help me in cursor issue in the chrome browser.







    Thanks
  5. Answer
    Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 18 Jun 2013 Link to this post

    Hi Dhamodharan,

    You can use the set_caretPosition property to change the caret position to the end. Use the .get_value().length to determinate the new caret position,.
    http://www.telerik.com/help/aspnet-ajax/input-client-side-radtextbox.html

    Regards,
    Vasil
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 25 Jun 2013 Link to this post

    Hi Vasil,
         Thanks for your reply,  set_caretPosition worked perfectly. 









    Thanks

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017