Textarea input can contain text line breaks such as vbCrLf. HTML does not display those text newlines as visible line breaks by itself, so trusted text can be transformed before display.
Replace(text_variable, vbCrLf, "<br>")
This corrects the old single-quoted '<BR>' example: in VBScript, a single quote begins a comment; string literals use double quotes.
text_variable comes from a user, HTML-encode it first and only then convert the encoded line breaks. Otherwise submitted HTML/script could be rendered by the browser.The original textarea line-break demo is retained for reference. The same transformation is useful for displaying multi-line textarea content. See the HTML line-break tutorial and the PHP nl2br() tutorial for equivalent concepts.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.