HTML_QuickForm annoyance
| From: | Tim Glen | Date: | Thu, 05 Sep 2002 21:51:44 +0000 |
| Subject: | HTML_QuickForm annoyance | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-2252@lists.php.net to get a copy of this message | ||
HI all,
I have a couple of small annoyances with HTML_QuickForm. They're not
technically bugs, but they can create some problems that look like bugs in
software based on HTML_QuickForm. Funnily enough, they both affect textareas
and not really anything else. Without further ado, here they are with
descriptions of what can happen.
Line 973 of QuickForm.php in function _wrapForm:
$html = str_replace("\n", "\n$tabs\t", $html);
The tabs added to every line of the form create spaces at the beginning of
every line of text in a textarea. I can understand wanting the HTML code
look tidy and tabbed but every time I edit a textarea, insert it into the
database and bring it back out, it gets moved over a little more. I
personally have commented this line out.
Line 203 of textarea.php
$html .= preg_replace("/(\r\n|\n|\r)/", '
', $this->_value);
This method seems to work fine in most browsers, but in IE5/mac (the browser
of choice in my company and several of our clients), the text 
 gets
printed out rather than a newline. Obviously, this doesn't really help any.
I have personally replace this line with the one below:
$html .= preg_replace("/(\r\n|\n|\r)/", "\n", $this->_value);
After a couple months of usage, I haven't found any side effects of doing
these things. Perhaps they could be introduced into the CVS?
--
tim glen
new media developer
sutton javelin corporate communications
phone (403) 265-9980
fax (403) 265-7662
email tim@javelindigital.com