This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You probably all have posted messages on this forum.text is entered in textArea forms and when you type a new line it is automatically transfered with the textarea form value text...
i want to implement this same behaviour : i have a jsp page with a form having a textarea . when i submit the form i want to have the text formated so each typed new line is transfer as a <br> html tag with texarea value text.
Why would you want to do something like this on submission? Seems more produdent to do it as a formatting step when displaying the data rather than when it is submitted.
Hi and thnx for your reply, it's important for my application to get input line by line so I can process it later...now if user types a new line in textArea how can the textarea form component know that ? can you please show some server side code to do that ? i appreciate a lot your help. thnx
Originally posted by othman El Moulat: it's important for my application to get input line by line
It depends what you mean by "line by line".
If by that you mean when the user enters a new line into the text area by hitting the Enter key, those will be reflected in the submitted value with line terminator characters. (Converting these to <br> tags isn't a great idea. Just leave the line terminators in order to demarcate the "lines").
If you mean the artificial soft-wrapping that occurs when the user reaches the width of the text area, that information is not available.
i will be entering a java program source code in the text area.. and then submit form . i want to get this program code as parameter value and then be able to split it into a well formated text and i want later to process each line of the program seperately. what is the best way to get a well formated java code text string in the standard format of java programs with seperate lines?