alain123
asked on
how can you avoid this to happend?
mmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mmmmmmmmmm mm
or use <wbr> after some characters! <wbr> will put line break if word is too long to display in one line!
<wbr> is non-standard and depends on browsers error correction.
Depending on error correction is never a good idea, so <wbr> should be avoided.
Depending on error correction is never a good idea, so <wbr> should be avoided.
ASKER
ok, but how do you control this on the html? not on the user level...
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!
You don't control it in the HTML, you control it before, or while, the HTML is being written/generated.
ASKER
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..
The specifics depend on the language you are using. An example in Perl:
#!/usr/bin/perl
my $bar = "asd";
my $foo = "qwertyuiopasdfghjklzxcvbn misjdhfuwe honxcoincd uisbieumod smfuidsbfu ierbfuisdn osdmgnfs";
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();
}
~
#!/usr/bin/perl
my $bar = "asd";
my $foo = "qwertyuiopasdfghjklzxcvbn
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();
}
~
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok so there is no way to control whis unless you trim it behind the scenes... really surprises me..
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
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
and in css?
overflow: hidden?
overflow: hidden?
it seems to hide the overflow, but does it pushes anything rightwards?
(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