Best way to format user input from forms

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
twilightnights
Forum Newbie
Posts: 3
Joined: Sun Jan 28, 2007 11:38 pm

Best way to format user input from forms

Post by twilightnights »

Anyone know a good way to do this?

Here is an example on my site.. I copied a joke for testing.. here is version with pre tags and set the font to sans serif via CSS

http://www.omgjokes.com/random.php?i=98

without pre
http://www.omgjokes.com/random.php?i=97

But the pre has a problem.. it scrolls way off the page. Is there a way to limit how much text is on one line with pre and make it wrap?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If memory serves, <pre> is a block level statement therefore unless otherwise specified will be as wide as required to contain your text. wordwrap() may be of interest.
twilightnights
Forum Newbie
Posts: 3
Joined: Sun Jan 28, 2007 11:38 pm

Post by twilightnights »

feyd wrote:If memory serves, <pre> is a block level statement therefore unless otherwise specified will be as wide as required to contain your text. wordwrap() may be of interest.
sweet wordwrap works well, ty
Post Reply