Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - New lines
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

New lines

 Post Reply Post Reply
Author
Scott07 View Drop Down
Groupie
Groupie


Joined: 04 July 2002
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scott07 Quote  Post ReplyReply Direct Link To This Post Topic: New lines
    Posted: 05 March 2003 at 9:43am

How do you make it so that you have a normal <TEXTAREA> box and the code will check to see if there are any new lines (as in

 

this).  What I am trying to get it to do is to convert all the HTML codes as in <,> ect into the & codes so people cant write HTML code but keep the new lines so if they put more than one paragraph in the spacing isent lost.  How you get what I am battering on about. 

 

Any help would be much appriciated, thanks. 

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2003 at 11:28am
are you letting people do <p></p> and <br> and <br /> (and also <br/>), or are you just trying to catch when they hit "enter" (creating a vbCrlf in the data), or both?
Contribute to the working anarchy we fondly call the Internet
Back to Top
Scott07 View Drop Down
Groupie
Groupie


Joined: 04 July 2002
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scott07 Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2003 at 2:28pm
so it only reconises when someone hits return but will reject <BR>
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2003 at 4:05pm
then there's two avenues you can take, with difference in the front end processing and resultant storage, but the same on display

1)
- Server.HTMLEncode the textarea's contents on the way in, all "returns" entered in the textarea are "vbCrlf"'s not <br> tags, so the encoding will leave the line breaks alone
- On the way to display, Replace(string,vbCrlf,"<br>") and line breaks work, but enterted HTML doesn't

2) (and the way i do/recommend it)
- Simply save the contents of the entered text (of course escaping the signle tics if needed)
- On the way out, do the Server.HTMLEncode on the field, then afterwards do a Replace(string,vbCrlf,"<br>")
- Since the replace of the line breaks happens after the encoding, the <br> tag will properly evaluate, while all user types HTML tags get "escaped" and show <tag>
Contribute to the working anarchy we fondly call the Internet
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2003 at 4:15pm
Contribute to the working anarchy we fondly call the Internet
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.