RE: [PHP-DB] verify text entry in a textarea doesn't work
Hi [EMAIL PROTECTED], I use the same type of checking on input type=text boxes and it works fine. Any ideas why it doesn't work on a textarea field? The crlf can be one reason. textareas are not the same like textboxes and you give them parameters how large (horizontal size) and how high (vertical size) it should be. Regards, Ruprecht -- Ruprecht Helms - IT-Service Softwareentwicklung == E-Mail: Ruprecht Helms [EMAIL PROTECTED] Date: 27-Aug-02 Time: 18:15:14 == Homepage: http://www.rheyn.de email: [EMAIL PROTECTED] Phone + Fax +49[0]7621 16 99 16 This message was sent by XFMail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] verify text entry in a textarea doesn't work
On Tuesday 27 August 2002 23:26, [EMAIL PROTECTED] wrote: I have some error checking routines for my web forms, and they are working great except for one field, a textarea field. I am using the following code, but it does not give an error when the field is empty: if (empty($feedback)) { $errmsg .= font color='red'liYou might want to enter some comments/li/font\n; } Presumably $errmsg is not appended to because empty($feedback) is FALSE. IOW $feedback is not empty, IOW $feedback contains something. What I'm getting at is when trying to debug some code, use a liberal dose of common-sense and logic. Print it out to see what it contains. Most likely it's whitespace. To convince yourself that it does contain something use strlen(). I use the same type of checking on input type=text boxes and it works fine. Any ideas why it doesn't work on a textarea field? What HTML code are you using to display the textarea field? Make sure there are no spaces and/or newlines in there. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Good judgement comes from experience. Experience comes from bad judgement. -- Jim Horning */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] verify text entry in a textarea doesn't work
Thankyou Jason, the problem was indeed in the html code. The code was broken into multiple lines and indented, by moving it all onto one line with no spaces between the it now works. Also, when I tab or place the cursor inside the textarea, the cursor now is placed in the upper left corner, whereas before it was one tab furthor into the box, now I know why that happens also. thanks, -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (They why do I have 9? Somebody help me!) Jason Wong [EMAIL PROTECTED] wrote on 08/27/2002 09:24:35 AM: On Tuesday 27 August 2002 23:26, [EMAIL PROTECTED] wrote: I have some error checking routines for my web forms, and they are working great except for one field, a textarea field. I am using the following code, but it does not give an error when the field is empty: if (empty($feedback)) { $errmsg .= font color='red'liYou might want to enter some comments/li/font\n; } Presumably $errmsg is not appended to because empty($feedback) is FALSE. IOW $feedback is not empty, IOW $feedback contains something. What I'm getting at is when trying to debug some code, use a liberal dose of common-sense and logic. Print it out to see what it contains. Most likely it's whitespace. To convince yourself that it does contain something use strlen(). I use the same type of checking on input type=text boxes and it works fine. Any ideas why it doesn't work on a textarea field? What HTML code are you using to display the textarea field? Make sure there are no spaces and/or newlines in there. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php