Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting textarea to HTML

Status
Not open for further replies.

ndratler

IS-IT--Management
Joined
Sep 27, 2001
Messages
1
Location
US
I have a form textarea on my page that allows users to type in several paragraphs of information. I would like to know if there exists some ASP script that will take these paragraphs and format them with the appropriate HTML tags (i.e. <P>,</P><BR>). I'm trying to add this information to an Access database and display it on a website, without having to open each Access field and add the HTML tags to the paragraphs. Can this be done? Or am I at a loss?
 
I personally use a .dll to do this, however, you could use the replace function, which goes soemthing like this...

<script language=vbscript>
function frmSomeForm_OnSubmit()
StrOutput = replace(frmSomeForm.Textareaname.Value,chr(13),&quot;<p>&quot;)

...some code to write strOutput to the database...
end function
</script>

This has worked for me in the past.

Play with it. The replace function is a VERY handy function.

Hope this helps! Tazzmann
 
I use the replace function very successfully to do this, the following will replace any textbox carriage returns with HTML <BR> tags...

strString = Replace(strString, vbCrLf, &quot;<BR>&quot;)

Hope this helps...

G -GTM Solutions, Home of USITE-
-=
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top