[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

how can you avoid this to happend?

Posted on 2004-04-01
14
Medium Priority
?
167 Views
Last Modified: 2010-08-05
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
0
Comment
Question by:alain123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +2
14 Comments
 
LVL 17

Expert Comment

by:dorward
ID: 10738530
By placing wrapable characters in the "word" so the browser has somewhere to wrap it.

(The usual complaint it 'but its user submitted data' - sanity check the data in your server side script and return it to the user with an error if any word is too long)

In theory you could also use a soft hyphan, but browser support sucks. http://www.cs.tut.fi/~jkorpela/shy.html
0
 
LVL 11

Expert Comment

by:Sven
ID: 10739298
or use <wbr> after some characters! <wbr> will put line break if word is too long to display in one line!
0
 
LVL 17

Expert Comment

by:dorward
ID: 10739309
<wbr> is non-standard and depends on browsers error correction.

Depending on error correction is never a good idea, so <wbr> should be avoided.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:alain123
ID: 10740311
ok, but how do you control this on the html? not on the user level...
0
 
LVL 11

Expert Comment

by:Sven
ID: 10740349
These long words are happening by posting some data, right? So there must be any script that gets the post and put it to a database or s.th. like that. There you have to do the work!
0
 
LVL 17

Expert Comment

by:dorward
ID: 10740357
You don't control it in the HTML, you control it before, or while, the HTML is being written/generated.
0
 
LVL 1

Author Comment

by:alain123
ID: 10745788
hi dor, so how do you control a user who wants to break your tables by posting those characters?  he's not going to take care of the wrapping..

0
 
LVL 17

Expert Comment

by:dorward
ID: 10746549
The specifics depend on the language you are using. An example in Perl:

#!/usr/bin/perl
                                                                                                                 
my $bar = "asd";
my $foo = "qwertyuiopasdfghjklzxcvbnmisjdhfuwehonxcoincduisbieumodsmfuidsbfuierbfuisdnosdmgnfs";
if ($foo =~ /[\S-]{20,}/) {
   $error = true;
   print "You have a string of 20 or more characters unbroken by white space (i.e. a very long word).";
   print "This is not allowed, please edit your submission and try again.";
}
                                                                                                                 
if ($error) {
  showFormAgain();
} else {
  processData();
}
~
0
 
LVL 6

Accepted Solution

by:
bvinson earned 750 total points
ID: 10748498
alain,

I think what most people are trying to say here is that in HTML, there is no way to control user input.

What you have to do is take control back if the user does something deliberate (such as your example above).
In order to take back control you'll needs to use some scripting language to validate the user input - how you do this / what scripting language you use is up to you.

Essentially, you want to make sure that its valid input and whatever method you choose should allow the flexibility for actual input while weeding out bad input.

The only real way I can think of in pure HTML is to put MAXLENGTH on your textbox(es) or textarea(s), but this might limit a valid input as well.

ASP, JSP, Perl, even Javascript validations should all work to help you make the "sanity check" dorward is talking about.

bvinson
0
 
LVL 1

Author Comment

by:alain123
ID: 10749292
ok so there is no way to control whis unless you trim it behind the scenes... really surprises me..
0
 
LVL 6

Expert Comment

by:bvinson
ID: 10749316
Remember, HTML is only a formatting mark-up.  To call it a language is to give it more credit than it deserves.

It has come a long way over the years, but it is still a method for formatting rather than manipulating input.

Sorry you weren't able to find a way to do what you wanted to do, but some times "no" is a valid answer to a question.  (Not intended as a jab.)

bvinson
0
 
LVL 1

Expert Comment

by:thurston_l
ID: 10753334
and in css?
overflow: hidden?
0
 
LVL 1

Expert Comment

by:thurston_l
ID: 10753368
it seems to hide the overflow, but does it pushes anything rightwards?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question