Hi!
Is there a way that you can limit the number of lines of text submitted through a form instead of the characters?
(no javascript pls)
[Forms] Limit lines instead of characters (updated problem!)
Moderator: General Moderators
[Forms] Limit lines instead of characters (updated problem!)
Last edited by thiscatis on Tue Aug 01, 2006 10:55 am, edited 1 time in total.
-
litebearer
- Forum Contributor
- Posts: 194
- Joined: Sat Mar 27, 2004 5:54 am
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
see:
Code: Select all
count_chars();
wordwrap();
explode() and count();could you be more precise?ole wrote:see:Code: Select all
count_chars(); wordwrap(); explode() and count();
The problem:
The input is done bya wysiwyg editor, when you hit enter it's gives <p align = left> text </p> as a new line.
This messes up my layout.
I already tried to do it with
Code: Select all
$text = substr($contenta,0,250);
$text = ereg_replace( "<p align="left">", " ", $text);
$text = ereg_replace( "</p>", "<br>", $text);anyone?
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
try
Code: Select all
$text = substr($contenta, 0, 250);
$text = str_replace('<p align="left">', '', $text);
$text = str_replace('</p>', '<br /><br />', $text);