do it in html/javascript like this:

<form action=""; 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';">

-----Original Message-----
From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:39 PM
Subject: [PHP] Trap CR or "Enter" possible?

In one of my php pages, I have a form that requires the user to click
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
"Educational" message about following instructions :>


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
for a query into PostgreSQL (it's coded between <?php  . . . ?>)

Any ideas, suggestions, or where to look would be appreciated.



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 --

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to