 |
| ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 7th, 2003, 06:17 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Plain text to html in a form
Hi,
Is there a way that a user can type plain text into a form Multi Text Box and it gets converted to html code when submitted, I.e. it puts in the <br> tags ?
Thanks,
Ells.
__________________
Cheers,
C.
Chris Ellis
Icon-Business Ltd
www.icon-business.net
[email protected]
|
|

August 13th, 2003, 02:49 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
You can try using regular expressions to replace the carriage-returns and newlines with <br> elements. There is a good tutorial on Regular Expressions on http://www.4guysfromrolla.com/webtech/120400-1.shtml. The "pattern" that you need to replace would be vbCrlF, which is the newline I am referring to.
Cheers!
Marlon Villarama
Support Team
Web Burner Hosting
[email protected]
www.webburner.com
877-535-2876
|
|

August 29th, 2003, 08:13 AM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If the problem is just of having <br/> tags then, just do the following. Display the text which U have in a <p></> tag. This would print the text as the user formatted it.
Thanks and regards,
Raj Babar
|
|

September 1st, 2003, 10:10 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by bsraj4u
If the problem is just of having <br/> tags then, just do the following. Display the text which U have in a <p></> tag. This would print the text as the user formatted it.
Thanks and regards,
Raj Babar
|
Thanks Raj, unfortunately, even with the text within the <p></p> tages, the carriage returns do not show.
My code looks like this:
<p><% response.write rsuser("Content") %></p>
Thanks for your help,
Chris.
Cheers,
C.
Chris Ellis
Icon-Business Ltd
www.icon-business.net
[email protected]
|
|

September 1st, 2003, 10:11 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by planeswalk
Hi,
You can try using regular expressions to replace the carriage-returns and newlines with <br> elements. There is a good tutorial on Regular Expressions on http://www.4guysfromrolla.com/webtec....shtml. The "pattern" that you need to replace would be vbCrlF, which is the newline I am referring to.
Cheers!
Marlon Villarama
Support Team
Web Burner Hosting
[email protected]
www.webburner.com
877-535-2876
|
Hi Marlon,
I already have code that replaces the ' with `
Is there a way to replace two things on the same line, I.e. replace ' with ` and vbCrlF with <br> ?
My code is:
UpdateContent = Replace(Request.Form("GetContent"),"'","`")
Cheers,
C.
Chris Ellis
Icon-Business Ltd
www.icon-business.net
[email protected]
|
|

September 1st, 2003, 10:41 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I've managed to get the replace working, but it doesn't seem to recognise the vbCrlF as the carriage return entered in the form.
If I change the code to replace the word ENTER to <br> it works.
The code is:
UpdateContent = Replace(Request.Form("GetContent"),"'","`")
UpdateContent = Replace(UpdateContent,"vbCrlF", "<br>")
Cheers,
C.
Chris Ellis
Icon-Business Ltd
www.icon-business.net
[email protected]
|
|

September 1st, 2003, 11:26 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I've sorted the problem out.
I used the following code in the display page:
<% = Replace(rsuser("Content"),VbCrLf, "<br>") %>
Thanks for all your help guys.
Cheers,
C.
Chris Ellis
Icon-Business Ltd
www.icon-business.net
[email protected]
|
|
 |