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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the "enter" key to write "<br>"

Status
Not open for further replies.

wniatbms

Programmer
Dec 5, 2003
24
0
0
ZA
Good day

How do I go about changing the value of the return or enter key when a user is typing in a 'textarea' on my form so that the return is display as <br> in the dbase?

Thanking you in advance.

William
 
After the form has been submitted do

Dim strtext
strText = replace(request.form("mytextbox, vbcrlf, "<BR>")

That should do it
 
Shatch.

Thank you so much. It works just fine.

Ciao
 
I'm not 100% sure what you're trying to do, but if you want the <BR> in to make sure there are line gaps when you output the date you could also just do this:

When you output the text from a db, read the relevant entry in to a string and then output it using:

<%=replace(ReadFile, VbCrLf, "<br>")%>

This will replace any carriage return with a <BR> automatically. You could also change it to add paragraphs or some other formatting.

Hope that helps,

Cass

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top