Wraping text while displaying it

D

dynamota

Hi All,


I have a page that has a text area where people can input text. They
submit the form and go to the next page which is a "preview" page. The
textarea data is displayed in a table/td whose width is set to 400.

But if some one puts in a data like
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

It's one continues string with no breaks.

How can I display the above text within a 200 width area? I am not able
to confine it to a width of 200. Its seems to keep rolling to the
right...

Any leads or suggestions will be useful.

tx in advance,
 
D

David Dorward

But if some one puts in a data like [snip]
one continues string with no breaks.

[the table data cell expands the width of the table]
Any leads or suggestions will be useful.

Don't let users input long words. Reject the form submission and insist they
add some spaces.
 
S

Steve Pugh

I have a page that has a text area where people can input text. They
submit the form and go to the next page which is a "preview" page. The
textarea data is displayed in a table/td whose width is set to 400.

But if some one puts in a data like
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

It's one continues string with no breaks.

How can I display the above text within a 200 width area? I am not able
to confine it to a width of 200. Its seems to keep rolling to the
right...

Is it 400 or 200?
Any leads or suggestions will be useful.

Go and hit your users around the head until they stop inputting such
stupid content. ;-)

You can't make content with no breakable characters break. So either
insert breakable characters or truncate the content. As you don't know
the user's chosen font size this will involve some amount of
guesswork.

If you stop trying to constrict the width of the container then the
problem will go away for some cases, which leaves you with more time
to track down and hit around the head the remainder.

Steve
 
D

dynamota

sorry

I would say a width of 400. Though you set it to 400, it expands beyond
400.

I might have to come with a way to implement some of the ideas
suggested.


tx
 
D

David Dorward

I would say a width of 400. Though you set it to 400, it expands beyond
400.

I might have to come with a way to implement some of the ideas
suggested.

You message headers claim that this is a response to my first post to this
thread, but you content looks like a response to Steve Pugh's, and you
haven't quoted anything.

Please read http://cfaj.freeshell.org/google/
 
D

dynamota

David,
Tx for the lessons in netiquette.

Looks like the only way to go is to write a function
I am planning to write a function that would put a break at certain
values(which will be passed as a parameter). I was hoping to use
html/css and avoid writing a function.


TX all......
 
J

Jonathan N. Little

David,
Tx for the lessons in netiquette.

Well you got one of two, you quoted but you top posted. FWIW your
remarkes should have been locate
|
V
Looks like the only way to go is to write a function
I am planning to write a function that would put a break at certain
values(which will be passed as a parameter). I was hoping to use
html/css and avoid writing a function.
|
V

TX all......
|
V
About down here under what you are responding to. and you should remove
the previous poster's signature(if your software doesn't do it
automatically), it's the bit after the '--'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top