This is a migrated thread and some comments may be shown as answers.

RadText box New line Problem in Chrome browser

4 Answers 55 Views
Input
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 14 Jun 2013, 12:00 PM
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



4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Jun 2013, 12:44 PM
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.
0
Dhamodharan
Top achievements
Rank 1
answered on 14 Jun 2013, 01:46 PM
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
0
Accepted
Vasil
Telerik team
answered on 18 Jun 2013, 08:52 AM
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.
0
Dhamodharan
Top achievements
Rank 1
answered on 25 Jun 2013, 04:57 PM
Hi Vasil,
     Thanks for your reply,  set_caretPosition worked perfectly. 









Thanks

Tags
Input
Asked by
Dhamodharan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dhamodharan
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or