Trap CR or "Enter" possible?
| From: | Andre Dubuc | Date: | Fri, 22 Mar 2002 02:39:25 +0000 |
| Subject: | Trap CR or "Enter" possible? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-89635@lists.php.net to get a copy of this message | ||
In one of my php pages, I have a form that requires the user to click "Search
for Surname". If however they press "Enter", undesirable effects occur.
I've successfully trapped if an empty string is in the <input
type="text"....>, but "Enter" eludes my efforts to trap it for an appropriate
"Educational" message about following instructions :>
ie:
if ($sname == "") {echo "Please enter a Surname and click "Search for
Surname'.", exit;}
if (eregi(\r == true) {exit;} // something tells me this isn't correct!!
Any ideas how I can accomplish this -- the code is asking for search criteria
for a query into PostgreSQL (it's coded between <?php . . . ?>)
Any ideas, suggestions, or where to look would be appreciated.
Tia,
Andre
----------
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.
May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/