This is a migrated thread and some comments may be shown as answers.
multiline radTextbox doesn't accept ENTER key
7 Answers 156 Views
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 2
Steven asked on 23 Sep 2008, 06:49 PM
I have the following multi-line textbox.
<telerik:RadTextBox ID="txtComment" runat="server"  
ValidationGroup="CommentValidation" CausesValidation="True" MaxLength="4096"  
Skin="Black" Width="450px" TextMode="MultiLine" Height="150px" AcceptReturn="True" /> 
I want to be able to start typing and when pressing the ENTER key I want to go to the next line. This won't work because now it will trigger the validation of the form.

I tried the solution from this (winforms) thread but that doesn't seem to work here.
How can I fix this?

(I am using the radEditorProvider (2008.2723) in DotNetNuke 4.8.4)




7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 24 Sep 2008, 07:09 AM
Hello Steven,

I just tried this with RequiredFieldValidator and everything worked fine on my end. Here is the code:
        <telerik:RadTextBox ID="txtComment" runat="server" ValidationGroup="CommentValidation" 
            CausesValidation="True" MaxLength="4096" Skin="Black" Width="450px" TextMode="MultiLine" 
            Height="150px" /> 
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtComment" 
            ErrorMessage="*" runat="server"></asp:RequiredFieldValidator> 
 


All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steven
Top achievements
Rank 2
answered on 24 Sep 2008, 07:45 AM
Hi Vlad,

I just found out what whas causing this.

I got a panel with a the default button property set:

<asp:Panel ID="pnlCommentSubmission" runat="server" DefaultButton="btnSubmitNewComment"
</asp:Panel> 

My radTextbox as mentioned above is inside this panel togeter with other fields and validators. When the DefaultButton Property is set pressing enter will fire the clientside validation. Without this property set pressing Enter will work perfectly in the multiline textbox BUT my clienside validation won't fire anymore. When I press the submitbutton my serverside validation will fire but not my clientside validation:
<asp:Button ID="btnSubmitNewComment" runat="server" Text="Submit your comment" CausesValidation="True" UseSubmitBehavior="True" ValidationGroup="CommentValidation" /> 


On my page (dotnetnuke module) there are other panels with validationgroups and defaultButtons so I kind of need to do it this way I believe. Is there a workaround or might there be something else I am missing?
0
Steven
Top achievements
Rank 2
answered on 24 Sep 2008, 09:51 PM
I got the multiline to work, think I made a typo or something cuz all of a sudden it does work without using the DefaultButton property.

However, if I submit the multiline message, when I show the submitted text in a label it shows the text single line.

» so when I submit :
test

test

» It will show in a label like:
test test

so after saving to the database and then getting the value back the linebreaks are lost.
0
Philip
Top achievements
Rank 1
answered on 22 Oct 2008, 03:49 PM
Hello!

I have a similar problem:

I hvae a RadTextBox with TextMode="MultiLine" in an ASP-Panel with a DefaultButton defined.
If I press enter within the Textbox, the form ist submitted resp. the validator fires.

In my opinion this is the wrong behavior of the TextBox?

Can you help me?

Greetings,
Philip
0
Pavel
Telerik team
answered on 24 Oct 2008, 10:07 AM
Hello Philip,

The problem is caused by the asp:Panel's DefaultButton property. Please refer to the following page for more information:

http://forums.asp.net/t/1294544.aspx


Sincerely yours,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Patrick
Top achievements
Rank 1
answered on 02 Mar 2011, 03:09 AM
Hello,

I have the same issue:

I enter text with carriage returns such as:
---------------------------------------------------------------------
Mikhail, E., Bethel, J., and McGlone, J. 2001. Introduction to Modern Photogrammetry

DeMers, M. 2008. Fundamentals of Geographical Information Systems

Longley, P., Goodchild, M., Maguire, D., and Rhind, D. 2005. Geographical Information Systems and Science OpenGIS. http://www.opensourcegis.org/

Gonzales, R., and Woods, R. 2007. Digital Image Processing
--------------------------------------------------------------------

Then I save it to my database. When I render it back from the database to an asp label or the radtextbox, it shows up as:

Mikhail, E., Bethel, J., and McGlone, J. 2001. Introduction to Modern Photogrammetry DeMers, M. 2008. Fundamentals of Geographical Information Systems Longley, P., Goodchild, M., Maguire, D., and Rhind, D. 2005. Geographical Information Systems and Science OpenGIS. http://www.opensourcegis.org/ Gonzales, R., and Woods, R. 2007. Digital Image Processing

Please assist.

Thanks,
Patrick
0
Pavel
Telerik team
answered on 03 Mar 2011, 12:17 PM
Hello Philip,

I am not sure how this problem is related to the previous one discussed in this thread. In any case I think RadEditor is more suitable for your scenario as it allows more flexibility in text formatting. Furthermore, the problem you have described seems to be related to the way you store the text in your database.

Kind regards,
Pavel
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Input
Asked by
Steven
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Steven
Top achievements
Rank 2
Philip
Top achievements
Rank 1
Pavel
Telerik team
Patrick
Top achievements
Rank 1
Share this question
or