Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TextArea and line breaks
Message
 
 
À
07/08/2017 15:43:19
Information générale
Forum:
HTML5
Catégorie:
HTML
Divers
Thread ID:
01653125
Message ID:
01653128
Vues:
41
>>I've checked this question
>>
>>https://stackoverflow.com/questions/863779/javascript-how-to-add-line-breaks-to-an-html-textarea
>>
>>What do you normally use in the interface to allow input with line breaks and correctly saving it in SQL Server?
>>
>>We're using TextArea and I my colleague just pointed out that line breaks are not preserved. So, I suppose we need to use something else instead of the TextArea unless we want to add some way to handle the line breaks.
>>
>>What do you normally use?
>
>Textarea, as is, is not HTMLed. It is just plain text. In the same as I do here, if you want to know when to add specific formatting to that content, when comes time to display, you would simply need to parse the content at runtime.
>
>So, basically, if you know the content that was saved in that field as to be displayed in HTML, then you would need to adjust accordingly at run time such as:
>
>
>		' If the content is Html
>		If lHtml Then
>		Else
>			lcNotes = oApp.StrTran(lcNotes, oApp.cCR, "< br >")
>		End If
>
For now I just tested saving the content. I added a line at the top which was supposed to be a comment on a separate line. When I looked in SQL Server and copied text and pasted in Notepad++ I didn't see any line breaks.

So, it looks like we're losing them.

I want a generic solution for this problem - we may need to use a different control. But still it's strange - why would it lose the line breaks? Should we probably use Shift+Enter when we insert the text?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform