do it in html/javascript like this: <form action="http://www.somewhere.com/" method="get" onSubmit="return (this.okay.value != 'no');"> <input type="hidden" name="okay" value="no"> <input type="text"> <input type="submit" onClick="this.form.okay.value = 'yes';"> </form>
-----Original Message----- From: Andre Dubuc [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 1:39 PM To: [EMAIL PROTECTED] Subject: [PHP] Trap CR or "Enter" possible? 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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php