multiline radTextbox doesn't accept ENTER key

8 posts, 0 answers
  1. Steven
    Steven avatar
    27 posts
    Member since:
    Jun 2008

    Posted 23 Sep 2008 Link to this post

    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)




  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 24 Sep 2008 Link to this post

    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.
  3. Steven
    Steven avatar
    27 posts
    Member since:
    Jun 2008

    Posted 24 Sep 2008 Link to this post

    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?
  4. Steven
    Steven avatar
    27 posts
    Member since:
    Jun 2008

    Posted 24 Sep 2008 Link to this post

    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.
  5. Philip
    Philip avatar
    40 posts
    Member since:
    Jan 2008

    Posted 22 Oct 2008 Link to this post

    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
  6. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 24 Oct 2008 Link to this post

    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.
  7. Patrick
    Patrick avatar
    2 posts
    Member since:
    Jul 2010

    Posted 01 Mar 2011 Link to this post

    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
  8. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 03 Mar 2011 Link to this post

    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!
Back to Top