Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - forcing a line break in editor
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

forcing a line break in editor

 Post Reply Post Reply Page  12>
Author
beej View Drop Down
Newbie
Newbie


Joined: 31 August 2003
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote beej Quote  Post ReplyReply Direct Link To This Post Topic: forcing a line break in editor
    Posted: 31 August 2003 at 12:21pm
Hi, i did a quick search for line break probs etc..couldnt find anything, but im sure ive read it in here somewhere..

the prob is, im experimenting with a 779pixel wide format for my pages, and i noticed if a user types in a long string of txt in the editor, it forces the table apart, thus disjointing the whole page. Is there any way of forcing a line break automatically?
Back to Top
God_Struth View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 August 2003
Location: United Kingdom
Status: Offline
Points: 218
Post Options Post Options   Thanks (0) Thanks(0)   Quote God_Struth Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2003 at 5:33pm
Something to do with word wrap, but I'll be shackled if I can remember what the whole answer was..
Back to Top
beej View Drop Down
Newbie
Newbie


Joined: 31 August 2003
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote beej Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2003 at 5:35pm
the editor word wraps fine, im talking about someone typing in something like thisssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2003 at 9:25pm

The only way to prevent was from happening would be to first check what's the longest the string could be without stretching the tables and then on the function that formats the posts add some code to split the post in words and check the lenght of each word and if it's too long split them in two (or whatever it takes depending on the lenght) and add a dash so that a long string like the one you just posted would be converted to something like thisssssssssssssssssssssssssssssssssssssssssssssssssssssssssss- sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss ...

Another solution would be to rewrite the HTML of the forum_posts.asp so that each post uses a table of it's own, that way if somebody posts a long string it would only mess up the layout of that post and not the whole page..... that's what most forums do.

Either one of these solutions won't we too easy to implement and IMO is not worth all that hassle...  also the first one will probably affect performance since you'd have to split the post in words and check each word one by one...

Back to Top
beej View Drop Down
Newbie
Newbie


Joined: 31 August 2003
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote beej Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2003 at 9:30pm
thanks for the reply, is there a way of the editor only allowing, say, a maximum single word limit? like say 60 characters or something..
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2003 at 9:43pm

No, I don't think there's a way to do that.

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2003 at 9:55pm
The easiest solution would be to write a function that checks the number of characters between spaces. If that number is greater than a certain number then return an error and allow the user to edit their post.

Realistically, no one should post a string of characters longer than 25-30 characters. This check would only have to be performed on post and edits, so the additional overhead would be minimal.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2003 at 3:08am
The biggest problem with checking the length of a word and forcing a line break if over a certain length is that it would also break links, images, etc., thus making the links, etc. not work.

Edited by -boRg-
Back to Top
 Post Reply Post Reply Page  12>

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.