| Author |
Topic Search Topic Options
|
beej
Newbie
Joined: 31 August 2003
Location: United States
Status: Offline
Points: 4
|
Post Options
Thanks(0)
Quote Reply
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?
|
 |
God_Struth
Senior Member
Joined: 07 August 2003
Location: United Kingdom
Status: Offline
Points: 218
|
Post Options
Thanks(0)
Quote Reply
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..
|
 |
beej
Newbie
Joined: 31 August 2003
Location: United States
Status: Offline
Points: 4
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 August 2003 at 5:35pm |
|
the editor word wraps fine, im talking about someone typing in something like thisssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.
|
 |
fernan82
Mod Builder Group
Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
|
Post Options
Thanks(0)
Quote Reply
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...
|
 |
beej
Newbie
Joined: 31 August 2003
Location: United States
Status: Offline
Points: 4
|
Post Options
Thanks(0)
Quote Reply
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..
|
 |
fernan82
Mod Builder Group
Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 August 2003 at 9:43pm |
No, I don't think there's a way to do that.
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
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-
|
|
|
 |