[CLOSED] TextArea has no linebreaks

  1. #1

    [CLOSED] TextArea has no linebreaks

    I have a TextArea field that has multiple lines. When I go to split the .Text property by newline, I see that the text is just all the lines as a single line separated by spaces.

    I'm using an up-to-date version of ext.net. Any ideas what might be wrong?
    Last edited by Daniil; Oct 22, 2012 at 1:03 PM. Reason: [CLOSED]
  2. #2
    I ran a test and was able to split the .Text value into separate lines using "\n".
    Geoffrey McGill
    Founder
  3. #3
    The funny thing is, I have 2 pages where I'm doing something similar. The first page works when splitting on newline, but this one doesn't.
  4. #4
    This sample seems to have to same problem. When I input more than one line, I only get one alert with all lines.

    <script runat="server">
    
        Protected Sub SubmitButton_Click(sender As Object, e As DirectEventArgs)
            For Each row In TestInput.Text.Split(vbNewLine)
                Ext.Net.X.Js.Alert(row)
            Next
        End Sub
    
    </script>
    
    <ext:Button runat="server" Text="Submit" OnDirectClick="SubmitButton_Click" />
    
    <ext:TextArea ID="TestInput" runat="server" />
  5. #5
    Ok, If I change it to .Split(vbLf) it works. That still doesn't explain why vbNewLine works on the other page.

    Do TextArea controls return the text delimited by \n in all cases? It seems like the only way that the other page would work would be if the text was actually separated by \r\n.
  6. #6
    Quote Originally Posted by jmcantrell View Post
    Ok, If I change it to .Split(vbLf) it works. That still doesn't explain why vbNewLine works on the other page.

    Do TextArea controls return the text delimited by \n in all cases? It seems like the only way that the other page would work would be if the text was actually separated by \r\n.
    I'm not sure. I believe this is up to the browser to determine how newline breaks are created.
    Geoffrey McGill
    Founder

Similar Threads

  1. Rich TextArea
    By ankit in forum 1.x Help
    Replies: 1
    Last Post: Jun 14, 2010, 3:46 PM
  2. TextArea wordwarp bug
    By JonG in forum 1.x Help
    Replies: 10
    Last Post: Mar 08, 2010, 11:22 AM
  3. Problem with ext:TextArea
    By hbbazan in forum 1.x Help
    Replies: 2
    Last Post: Feb 24, 2010, 3:38 PM
  4. Missing Linebreaks in DataView Template
    By GolchK in forum 1.x Help
    Replies: 4
    Last Post: Nov 02, 2009, 5:50 PM
  5. TextArea in IE6 can not display??
    By wkcode in forum 1.x Help
    Replies: 1
    Last Post: Apr 01, 2009, 11:30 PM

Posting Permissions